<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>API on Arg2p Wiki</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/</link><description>Recent content in API on Arg2p Wiki</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://tuprolog.github.io/arg2p-kt/docs/api/index.xml" rel="self" type="application/rss+xml"/><item><title>Engine predicates</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/engine/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/engine/</guid><description>&lt;h2 id="engine-interface"&gt;Engine Interface&lt;a class="anchor" href="#engine-interface" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;All the predicates below belong to the &lt;code&gt;arg2p&lt;/code&gt; module, and the recommended way to call them is through the&#10;module prefix — &lt;code&gt;arg2p::solve(Goal, Res)&lt;/code&gt;, &lt;code&gt;arg2p::buildLabelSets(...)&lt;/code&gt; and so on. The unqualified form works&#10;too where &lt;code&gt;arg2p&lt;/code&gt; is a static library, as in the solvers of &lt;code&gt;Arg2pSolver.default()&lt;/code&gt;, but the qualified one states where the predicate comes from and keeps working if your own theory defines&#10;a predicate with the same name.&lt;/p&gt;</description></item><item><title>Flags</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/flags/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/flags/</guid><description>&lt;h2 id="flags-reference"&gt;Flags Reference&lt;a class="anchor" href="#flags-reference" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Flags are ordinary Prolog facts. The engine reads them from the knowledge base while it evaluates a theory,&#10;so a flag can be set in three ways:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;in the theory itself&lt;/strong&gt;, by writing the fact (e.g. &lt;code&gt;queryMode.&lt;/code&gt;);&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;from the API&lt;/strong&gt;, through &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/kotlin/#flags"&gt;&lt;code&gt;Flags&lt;/code&gt;&lt;/a&gt; (in Kotlin, JavaScript and Python), each&#10;flag with a method taking a value of its enumeration (&lt;code&gt;Semantics.PREFERRED&lt;/code&gt;, &lt;code&gt;Profile.ABA&lt;/code&gt;, &amp;hellip;);&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;from the &lt;a href="https://tuprolog.github.io/arg2p-kt-web/"&gt;playground&lt;/a&gt;&lt;/strong&gt; and the extension of VS Code, through the&#10;&lt;em&gt;Flags&lt;/em&gt; panel of the solver.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;A flag stated in the theory replaces the value the solver was given for it: a theory stating&#10;&lt;code&gt;graphExtension(bp).&lt;/code&gt; has only that extension, not the &lt;code&gt;standardPref&lt;/code&gt; of &lt;code&gt;Flags.defaults()&lt;/code&gt; as well.&#10;&lt;code&gt;graphExtension(none).&lt;/code&gt; states no extension, and a switch is turned off by &lt;code&gt;Switch(off).&lt;/code&gt; (e.g.&#10;&lt;code&gt;autoTransposition(off).&lt;/code&gt;).&lt;/p&gt;</description></item><item><title>Kotlin</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/kotlin/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/kotlin/</guid><description>&lt;h2 id="kotlin-api"&gt;Kotlin API&lt;a class="anchor" href="#kotlin-api" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;There are two ways to use Arg2P from Kotlin or Java:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;The API of arg2p&lt;/strong&gt; — &lt;code&gt;Arg2p&lt;/code&gt;, a solver for a theory: its answers, graphs and solutions as Kotlin objects, its&#10;flags as enumerations, and the causality tests. Start here: it is the same API in&#10;&lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/javascript/"&gt;JavaScript&lt;/a&gt; and, in snake case, in &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/python/"&gt;Python&lt;/a&gt;,&#10;and nothing of 2P-Kt is needed.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;The 2P-Kt integration&lt;/strong&gt; — load Arg2P as a library into your own &lt;code&gt;Solver&lt;/code&gt; and query it with Prolog goals.&#10;Use this when you need the full Prolog interface, custom libraries, or an existing 2P-Kt setup.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The API is in the aggregate artifact &lt;code&gt;arg2p&lt;/code&gt; (&lt;code&gt;arg2p-jvm&lt;/code&gt; on the JVM), with every module of Arg2P (the core, the&#10;causality and the parallel solver), package &lt;code&gt;it.unibo.tuprolog.argumentation&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>JavaScript</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/javascript/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/javascript/</guid><description>&lt;h2 id="javascript-api"&gt;JavaScript API&lt;a class="anchor" href="#javascript-api" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The npm package &lt;code&gt;@tuprolog/arg2p&lt;/code&gt; exposes the &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/kotlin/"&gt;API of arg2p&lt;/a&gt; to JavaScript, as it is&#10;in Kotlin: a solver for a theory (&lt;code&gt;Arg2p&lt;/code&gt;), its flags (&lt;code&gt;Flags&lt;/code&gt;, with an enumeration for the values of each), its&#10;answers, graphs and solutions, the values of Prolog terms (&lt;code&gt;Value&lt;/code&gt;), the causality tests, and the clusters of the&#10;&lt;a href="https://tuprolog.github.io/arg2p-kt/docs/modules/parallel-solver/"&gt;parallel solver&lt;/a&gt;. Nothing of tuProlog is needed.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;&amp;#34;dependencies&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;&amp;#34;@tuprolog/arg2p&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#4e9a06"&gt;&amp;#34;0.21.0&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;import&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt; &lt;span style="color:#000"&gt;Arg2p&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;Flags&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;Value&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;Semantics&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;Profile&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;GraphExtension&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt; &lt;span style="color:#000"&gt;from&lt;/span&gt; &lt;span style="color:#4e9a06"&gt;&amp;#39;@tuprolog/arg2p&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The package is an ES module (Node.js, bundlers, Deno, browsers), every declaration of the API exported by its name.&lt;/p&gt;</description></item><item><title>Python</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/python/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/python/</guid><description>&lt;h2 id="python-api"&gt;Python API&lt;a class="anchor" href="#python-api" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The Python package &lt;code&gt;arg2p&lt;/code&gt; is the &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/kotlin/"&gt;API of arg2p&lt;/a&gt; in snake case: a solver for a&#10;theory (&lt;code&gt;Arg2p&lt;/code&gt;), its flags (&lt;code&gt;Flags&lt;/code&gt;, with an enumeration for the values of each), its answers, graphs and&#10;solutions, the causality tests, and the clusters of the &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/modules/parallel-solver/"&gt;parallel solver&lt;/a&gt;.&#10;It runs the library of the JVM through &lt;a href="https://jpype.readthedocs.io"&gt;JPype&lt;/a&gt;, on the Java runtime its wheel bundles:&#10;no Java is needed.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pip install arg2p&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The wheels of Windows (x86-64), Linux (x86-64, ARM64) and macOS (ARM64, x86-64) bundle a Java runtime; on another&#10;platform the package runs on the Java of the system (21 or later, &lt;code&gt;JAVA_HOME&lt;/code&gt;). &lt;code&gt;ARG2P_JVM&lt;/code&gt; names another library of&#10;the JVM to run on (&lt;code&gt;arg2p mcp&lt;/code&gt; runs the &lt;code&gt;java&lt;/code&gt; of its runtime), &lt;code&gt;ARG2P_CLASSPATH&lt;/code&gt; other jars, put before those of the&#10;package: their classes are the ones loaded, and the package gives those they lack.&lt;/p&gt;</description></item><item><title>Kotlin &amp; JS reference</title><link>https://tuprolog.github.io/arg2p-kt/docs/api/reference/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://tuprolog.github.io/arg2p-kt/docs/api/reference/</guid><description>&lt;h2 id="kotlin--js-reference"&gt;Kotlin &amp;amp; JS reference&lt;a class="anchor" href="#kotlin--js-reference" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The reference of every public class and function of the core (&lt;code&gt;core&lt;/code&gt;), of the causality solver and of the npm package&#10;&lt;code&gt;@tuprolog/arg2p&lt;/code&gt;, generated by &lt;a href="https://kotlinlang.org/docs/dokka-introduction.html"&gt;Dokka&lt;/a&gt; from their KDoc. The&#10;declarations usable from JavaScript are those of the &lt;code&gt;js&lt;/code&gt; packages (see &lt;a href="https://tuprolog.github.io/arg2p-kt/docs/api/javascript/"&gt;JavaScript&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="book-btn" href="https://tuprolog.github.io/arg2p-kt/api/reference/index.html"&gt;Open the reference&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>