@tuprolog/arg2p 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,120 +1,131 @@
1
1
  # Arg2P
2
2
 
3
- Quick links:
3
+ Arg2P is a lightweight implementation of the ASPIC<sup>+</sup> framework for structured argumentation.
4
+ Built on top of the [tuProlog](http://pika-lab.gitlab.io/tuprolog/2p-kt/) engine, it supports both JVM and Node environments.
4
5
 
5
- - [GitLab Repository](https://gitlab.com/pika-lab/argumentation/arg2p-kt)
6
- - [GitHub Repository](https://github.com/tuProlog/arg2p-kt)
7
- - [Maven Repository](https://search.maven.org/search?q=g:it.unibo.tuprolog.argumentation)
8
- - [NPM Package](https://www.npmjs.com/package/@tuprolog/arg2p-core)
9
- - [Documentation](https://pika-lab.gitlab.io/argumentation/arg2p-kt)
6
+ More details are available on the [official wiki](https://pika-lab.gitlab.io/argumentation/arg2p-kt/).
10
7
 
8
+ ---
11
9
 
12
- Arg2Prolog is a lightweight implementation of the ASPIC<sup>+</sup>-like framework for structured argumentation.
13
- It is built on the top of the [tuProlog](http://pika-lab.gitlab.io/tuprolog/2p-in-kotlin/) engine.
10
+ ## Getting Started
14
11
 
15
- More information about the project can be found on the [official wiki](https://pika-lab.gitlab.io/argumentation/arg2p-kt/).
12
+ Arg2p is available as a [2P-Kt](http://pika-lab.gitlab.io/tuprolog/2p-kt/) library.
16
13
 
17
- ### Get Started
14
+ #### JVM Library - Gradle
18
15
 
19
- The Arg2p library is available in two different forms: as a standalone application (Arg2p Java IDE), and as a [2P-Kt](http://pika-lab.gitlab.io/tuprolog/2p-in-kotlin/) library.
16
+ To import the Arg2p module (version `ARG2P_VERSION`) into your Kotlin-based Gradle project, declare the dependency in your `build.gradle(.kts)` file:
17
+ ```kotlin
18
+ repositories {
19
+ mavenCentral()
20
+ }
21
+
22
+ dependencies {
23
+ implementation("it.unibo.tuprolog.argumentation:arg2p-jvm:ARG2P_VERSION")
24
+ }
25
+ ```
26
+
27
+ #### Usage Example
20
28
 
21
- #### Graphical User Interface
29
+ ```kotlin
30
+ import it.unibo.tuprolog.argumentation.core.Arg2pSolverFactory
31
+ import it.unibo.tuprolog.argumentation.core.libs.basic.FlagsBuilder
32
+
33
+ fun main() {
34
+ val graph = Arg2pSolverFactory.evaluate("""
35
+ f1 :=> d.
36
+ f2 :=> -d.
37
+ """.trimIndent(), FlagsBuilder()).first()
38
+
39
+ graph.labellings.forEach {
40
+ println("${it.label} : ${it.argument.conclusion}")
41
+ }
42
+ }
43
+ ```
22
44
 
23
- If you need a GUI for your Prolog interpreter, you can rely on the Arg2p IDE which is available on the [Releases section of the
24
- GitHub repository](https://github.com/tuProlog/arg2p-kt/releases).
45
+ For a complete example, check out the [GitHub demo](https://github.com/Gilbocc/arg2p-kt-demo).
25
46
 
26
- The page of the [latest release](https://github.com/tuProlog/arg2p-kt/releases/latest) of Arg2P exposes a number of _Assets_.
27
- There, the one named:
28
- ```
29
- arg2p-ide-VERSION-redist.jar
47
+ #### NPM Library
48
+
49
+ The Arg2P software is available on NPM as a JavaScript library as well. It can be found under the [`@tuprolog` organization](https://www.npmjs.com/org/tuprolog).
50
+ To use the library, add the dependency to your `package.json`:
51
+
52
+ ```json
53
+ {
54
+ "dependencies": {
55
+ "@tuprolog/arg2p": "ARG2P_VERSION"
56
+ }
57
+ }
30
58
  ```
31
- is the self-contained, executable Jar containing the 2P-Kt-based Prolog interpreter (`VERSION` may vary depending on the
32
- actual release version).
33
59
 
34
- After you download the `arg2p-ide-VERSION-redist.jar`, you can simply launch it by running:
35
- ```bash
36
- java -jar arg2p-ide-VERSION-redist.jar
60
+ #### Usage Example
61
+
62
+ ```js
63
+ const arg2p = require('@tuprolog/arg2p').it.unibo.tuprolog.argumentation.bridge.JsBridge
64
+
65
+ const graph = arg2p.solve('buildLabelSets', `
66
+ f1 :=> d.
67
+ f2 :=> -d.`, `
68
+ graphBuildMode(standard_af).
69
+ statementLabellingMode(statement).
70
+ argumentLabellingMode(grounded_hash).
71
+ orderingPrinciple(last).
72
+ orderingComparator(elitist).
73
+ graphExtension(standardPref).
74
+ queryMode.`, _ => { }).i.next().graph
75
+
76
+ graph.arguments.forEach(arg => {
77
+ console.log(`${arg.label} : ${arg.descriptor}`)
78
+ })
37
79
  ```
38
- However, if you have properly configured the JVM on your system, it may be sufficient to just double-click on the JAR to start the IDE.
39
80
 
40
- There, one may query the Arg2p Prolog interpreter against the currently opened theory file, which can of course be
41
- loaded from the user's file system by pressing <kbd>File</kbd> and then <kbd>Open...</kbd>.
81
+ For a complete example, see the [repository](https://github.com/tuProlog/arg2p-kt-web).
42
82
 
43
- To issue a query, the user must write it in the query text field, at the center of the application.
44
- By either pressing <kbd>Enter</kbd> while the cursor is on the query text field, or by clicking on the <kbd>&gt;</kbd> button, the user can start a new resolution process, aimed at solving the provided query.
45
- Further solutions can be explored by clicking on the <kbd>&gt;</kbd> over and over again.
46
- One may also compute all the unexplored solutions at once by clicking on the <kbd>&gt;&gt;</kbd> button.
83
+ ---
47
84
 
48
- To perform a novel query, the user may either:
49
- - write the new query in the query text field, and then press <kbd>Enter</kbd>, or
50
- - click on the <kbd>X</kbd> (Stop) button, write the new query in the query text field, and then press <kbd>&gt;</kbd>.
85
+ ## Arg2p IDE
51
86
 
52
- For a deeper introduction on the Arg2p IDE you can refer to the original [2P-Kt](https://gitlab.com/pika-lab/tuprolog/2p-in-kotlin) page.
53
- The Arg2p version of the IDE introduces two additional tabs:
54
- - the _Graph_ tab, containing the graphical representation of the abstract argumentation graph (available only if leveraging the abstract query mode -- `buildLabelSet` predicate);
55
- - the _Arg Flag_ tab, allowing the user to see/modify the values of the Arg2p flags. A comprehensive description of these values can be found on the [official wiki](https://pika-lab.gitlab.io/argumentation/arg2p-kt/wiki/predicate).
87
+ The Arg2p IDE is available on the [Releases section of the
88
+ GitHub repository](https://github.com/tuProlog/arg2p-kt/releases/latest).
56
89
 
57
- #### Gradle users
90
+ ![Java IDE](./imgs/javaide.png)
58
91
 
59
- To import the Arg2p module (version `ARG2P_VERSION`) into your Kotlin-based project leveraging on Gradle,
60
- you simply need to declare the corresponding dependency in your `build.gradle(.kts)` file:
61
- ```kotlin
62
- dependencies {
63
- implementation("it.unibo.tuprolog.argumentation", "arg2p", "ARG2P_VERSION")
64
- }
65
- ```
92
+ In the [latest release](https://github.com/tuProlog/arg2p-kt/releases/latest) page, download the _Asset_ named:
93
+ ```
94
+ arg2p-ide-ARG2P_VERSION-redist.jar
95
+ ```
96
+ a self-contained, executable Jar containing the 2P-Kt-based Prolog interpreter (`ARG2P_VERSION` will vary depending on the
97
+ actual release version).
66
98
 
67
- Don't forget to tell Gradle to use Maven Central as a source for dependency lookup. You can do it as follows:
68
- ```kotlin
69
- repositories {
70
- mavenCentral()
71
- }
72
- ```
99
+ After you download the `arg2p-ide-ARG2P_VERSION-redist.jar`, you can simply launch it by running:
100
+ ```bash
101
+ java -jar arg2p-ide-ARG2P_VERSION-redist.jar
102
+ ```
103
+ If your JVM is properly configured, you can also start the IDE by double-clicking the JAR file.
73
104
 
74
- ##### JVM-only projects with Gradle
105
+ ### Features
75
106
 
76
- In the case your project only targets the JVM platform, remember to add the `-jvm` suffix to the module name:
77
- ```kotlin
78
- dependencies {
79
- implementation("it.unibo.tuprolog.argumentation", "arg2p-jvm", "ARG2P_VERSION")
80
- }
81
- ```
107
+ - **Query Execution:** Write your query in the text field and hit <kbd>Enter</kbd> or click <kbd>&gt;</kbd>.
108
+ - **Solution Exploration:** Click <kbd>&gt;</kbd> for the next solution or <kbd>&gt;&gt;</kbd> to compute all solutions.
109
+ - **New Query:** Click <kbd>X</kbd> to stop the current query, then enter a new one.
82
110
 
83
- #### Maven users
111
+ ### Additional Tabs
84
112
 
85
- To import the Arg2p module (version `ARG2P_VERSION`) into your Kotlin-based project leveraging on Maven,
86
- you simply need to declare the corresponding dependency in your `pom.xml` file:
87
- ```xml
88
- <dependency>
89
- <groupId>it.unibo.tuprolog.argumentation</groupId>
90
- <artifactId>arg2p</artifactId>
91
- <version>ARG2P_VERSION</version>
92
- </dependency>
93
- ```
113
+ - **Graph Tab:** Displays a graphical representation of the abstract argumentation graph.
114
+ - **Arg Flag Tab:** Shows and allows modification of Arg2P flags. Detailed descriptions are on the [official wiki](https://pika-lab.gitlab.io/argumentation/arg2p-kt/wiki/predicate).
94
115
 
95
- ##### JVM-only projects with Maven
116
+ ---
96
117
 
97
- In the case your project only targets the JVM platform, remember to add the `-jvm` suffix to the module name:
98
- ```xml
99
- <dependency>
100
- <groupId>it.unibo.tuprolog.argumentation</groupId>
101
- <artifactId>arg2p-jvm</artifactId>
102
- <version>ARG2P_VERSION</version>
103
- </dependency>
104
- ```
118
+ ## Arg2p Playground
105
119
 
106
- #### NPM users
120
+ Try Arg2P directly in your browser using the [Web Playground](https://legalmachinelab.unibo.it/arg2p).
107
121
 
108
- The Arg2P software is available on NPM as a JavaScript library as well. It can be found under the [`@tuprolog` organization](https://www.npmjs.com/org/tuprolog).
109
- To import the Arg2p library into your `package.json`, it is sufficient to declare your dependency as follows:
110
- ```json
111
- {
112
- "dependencies": {
113
- "@tuprolog/arg2p-core": "^ARG2P_MODULE_VERSION"
114
- }
115
- }
116
- ```
122
+ ![Web Playground](./imgs/playground.png)
123
+
124
+ It functions the same as the Java IDE, offering an interactive experience without installation.
125
+
126
+ ---
117
127
 
118
- ### Issue tracking
128
+ ## Issue tracking
119
129
 
120
- If you meet some problem in using Arg2p, you are encouraged to signal it through the project ["Issues" section](https://gitlab.com/pika-lab/argumentation/arg2p-kt/-/issues) on GitLab.
130
+ If you encounter any issues, please report them on the [GitHub Issues](https://github.com/tuProlog/arg2p-kt/issues) page.
131
+ Your feedback helps improve the project!
@@ -190,17 +190,28 @@
190
190
  var element_0 = tmp0_iterator_0.u();
191
191
  // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>' call
192
192
  // Inline function 'kotlin.collections.flatMap' call
193
- // Inline function 'kotlin.collections.flatMapTo' call
193
+ // Inline function 'kotlin.collections.filter' call
194
+ // Inline function 'kotlin.collections.filterTo' call
194
195
  var this_2 = attackers($this, element_0.w3l_1, graph);
195
196
  var destination_1 = ArrayList_init_$Create$();
196
197
  var tmp0_iterator_1 = this_2.r();
197
198
  while (tmp0_iterator_1.s()) {
198
199
  var element_1 = tmp0_iterator_1.u();
199
200
  // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>.<anonymous>' call
200
- var list = supporters($this, element_1.w3l_1, graph);
201
- addAll(destination_1, list);
201
+ if (!(element_1.w3l_1.l3l_1 === x.l3l_1)) {
202
+ destination_1.o(element_1);
203
+ }
204
+ }
205
+ // Inline function 'kotlin.collections.flatMapTo' call
206
+ var destination_2 = ArrayList_init_$Create$();
207
+ var tmp0_iterator_2 = destination_1.r();
208
+ while (tmp0_iterator_2.s()) {
209
+ var element_2 = tmp0_iterator_2.u();
210
+ // Inline function 'it.unibo.tuprolog.argumentation.causality.libs.CausalitySolver.supporters.<anonymous>.<anonymous>' call
211
+ var list = supporters($this, element_2.w3l_1, graph);
212
+ addAll(destination_2, list);
202
213
  }
203
- var list_0 = destination_1;
214
+ var list_0 = destination_2;
204
215
  addAll(destination_0, list_0);
205
216
  }
206
217
  return plus(tmp, destination_0);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../causality-solver/src/commonMain/kotlin/it/unibo/tuprolog/argumentation/causality/libs/CausalitySolver.kt","common/src/generated/_Collections.kt","src/kotlin/util/Standard.kt"],"sourcesContent":[null,null,null],"names":["CausalitySolver$CausalityCheckCause$solve$lambda$lambda","it","$this_arg2pScope","CausalitySolver$CausalityCheckCause$solve$lambda$lambda$lambda","$request","$effect","$intervention","CausalitySolver$CausalityCheckCause$solve$lambda","$rules","$cause","$this$arg2pScope","equalTerms","a","b","attackers","x","graph","element","item","supporters","list","solveFresh","kb","getSupports","effect","checkBaseTheory","request","checkIntervention","intervention","support","getSubsets","checkCausality","supports","<init>","<get-signature>","solve","cause","rules","CausalitySolver$getSupports$lambda","CausalitySolver$getSupports$lambda$lambda","$graph","CausalitySolver$checkBaseTheory$lambda","CausalitySolver$getSubsets$lambda$lambda","CausalitySolver$getSubsets$lambda$lambda$lambda","CausalitySolver$getSubsets$lambda","clean","string","<get-alias>","<get-baseContent>","capacity","identifier","<get-theoryOperators>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAiKwFA,CAAAC,EAAAD,EAAA;A,IACzD,OAAH,EAAG,M;EACP,C;oEAAMA,CAHCE,gBAGDF,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAuB,OAAH,cAAlB,EAAG,MAAH,IAAgB,sBAAhB,CAAkB,CAAG,a;IAAa,C;G;oEAC9BH,CAnIpC,M,EA0G2BI,Q,EAGfC,OAsBwBL,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAE,8BAAe,QAAf,EAAwB,EAAxB,EAA4B,OAA5B,C;IAAoC,C;G;oEACzCH,CAzBrBM,aAyBqBN,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAe,kCAAG,aAAH,EAAiB,EAAjB,C;IAAqB,C;G;2DALtCI,CArBJH,Q,EAcfI,M,EAZAC,M,EA5GZ,M,EA6GYJ,O,EAFAC,aAoBmBC,E;oBAAAP,CAAAU,gBAAAV,EAAA;A,gBACP,QAAQ,OAAM,8BAAC,wBAAD,EAAyB,MAAzB,EAAgC,SAAO,sBAAP,CAAhC,CAAN,C;kBAAiD,YAAO,uDAAP,C;kBAEvD,WAAI,2EAAJ,C;kBACG,cAAO,oFAAP,C;UAHL,iBAKK,YADA,WAAI,wEAAJ,CACA,C;MALL,gCAKmC,gCALnC,iB;IAMJ,C;G;qBAnIRW,C,OACJC,C,EACAC,CAFIF,EAGJ;A,IAAsD,OAA3C,+BAAQ,OAAW,8BAAM,CAAN,CAAX,EAA0B,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G,a;IAAa,C;G;4CAH/BC,CAFXxC,Q,EACAE,aACWsC,E;oBAAAF,CAAAhC,gBAAAgC,EAAA;A,gBACX,QAAQ,OAAM,8BAAC,gBAAD,EAAiB,aAAjB,EAA+B,wBAA/B,CAAN,C;kBAAyC,YAAO,wCAAP,C;MAEL,cAA1C,WAAI,4DAAJ,CAA0C,C;IAChD,C;G;0BAtEJT,CAAAA,EAAA;A,IA4IyB,oD;IAqDZ,aAFS,0BACT,iBAAoB,0BAApB,CACA,2CAAiB,OAAjB,C;EAjMb,C;0CACIY,CAAUC,MAAVD,EAA4B;A,IAAwC,OAAhB,QAAjB,QAAP,MAAO,EAAS,GAAT,EAAa,EAAb,CAAiB,EAAS,GAAT,EAAa,EAAb,C;EAAe,C;0CA2I1DE,CAAAA,EAAA;A,IAAA,iB;EAAkD,C;0CAGvDC,CAAAA,EACI;A;;;qBEpBy8D,OAAO,uCAA8B,6BAA9B,CAAP,C;;;QD4gCj9DC,WAAwD,cAAzC,YAAY,wBA17BmC,UA07BnC,EAAwB,EAAxB,CAAZ,CAAyC,EAAc,EAAd,C;;sBACnC,4BAAoB,QAApB,C;QA2BL,gBAt9B8C,UAs9B9C,I;WAAA,iB,EAAhB;A,UAAKhC,UAAW,iB;;sBDj+Bg24B,OAhDvz4B,M;MCkhCrD,WAAY,IAAI,SAAJ,EAA0B,OAA1B,C;IAChB,C;ID/+BS,OAtCW,OACI,IADJ,CACS,KADT,ECshCb,WDthCa,EAIO,+CA8BC,2oBA9BD,EA+BH,IA/BG,CA+BH,KA/BG,CAJP,C;EAsCZ,C;0CAKCiC,CAAAA,EAA2B;A,IAAU,OAAT,W;EAAS,C;0CAErCC,CAAAA,EAAA;A,IAAA,iB;EAGwB,C;;;;;;;;;;"}
1
+ {"version":3,"sources":["../../../../../../causality-solver/src/commonMain/kotlin/it/unibo/tuprolog/argumentation/causality/libs/CausalitySolver.kt","common/src/generated/_Collections.kt","src/kotlin/util/Standard.kt"],"sourcesContent":[null,null,null],"names":["CausalitySolver$CausalityCheckCause$solve$lambda$lambda","it","$this_arg2pScope","CausalitySolver$CausalityCheckCause$solve$lambda$lambda$lambda","$request","$effect","$intervention","CausalitySolver$CausalityCheckCause$solve$lambda","$rules","$cause","$this$arg2pScope","equalTerms","a","b","attackers","x","graph","element","item","supporters","list","solveFresh","kb","getSupports","effect","checkBaseTheory","request","checkIntervention","intervention","support","getSubsets","checkCausality","supports","<init>","<get-signature>","solve","cause","rules","CausalitySolver$getSupports$lambda","CausalitySolver$getSupports$lambda$lambda","$graph","CausalitySolver$checkBaseTheory$lambda","CausalitySolver$getSubsets$lambda$lambda","CausalitySolver$getSubsets$lambda$lambda$lambda","CausalitySolver$getSubsets$lambda","clean","string","<get-alias>","<get-baseContent>","capacity","identifier","<get-theoryOperators>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAiKwFA,CAAAC,EAAAD,EAAA;A,IACzD,OAAH,EAAG,M;EACP,C;oEAAMA,CAHCE,gBAGDF,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAuB,OAAH,cAAlB,EAAG,MAAH,IAAgB,sBAAhB,CAAkB,CAAG,a;IAAa,C;G;oEAC9BH,CAnIpC,M,EA0G2BI,Q,EAGfC,OAsBwBL,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAE,8BAAe,QAAf,EAAwB,EAAxB,EAA4B,OAA5B,C;IAAoC,C;G;oEACzCH,CAzBrBM,aAyBqBN,E;oBAAAG,CAAAF,EAAAE,EAAA;A,MAAe,kCAAG,aAAH,EAAiB,EAAjB,C;IAAqB,C;G;2DALtCI,CArBJH,Q,EAcfI,M,EAZAC,M,EA5GZ,M,EA6GYJ,O,EAFAC,aAoBmBC,E;oBAAAP,CAAAU,gBAAAV,EAAA;A,gBACP,QAAQ,OAAM,8BAAC,wBAAD,EAAyB,MAAzB,EAAgC,SAAO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gG,UAs9BhG,I;WAAA,iB,EAAhB;A,UAAKhC,UAAW,iB;;sBDj+B8y4B,OAhDrw4B,M;MCkhCrD,WAAY,IAAI,SAAJ,EAA0B,OAA1B,C;IAChB,C;ID/+BS,OAtCW,OACI,IADJ,CACS,KADT,ECshCb,WDthCa,EAIO,+CA8BC,2oBA9BD,EA+BH,IA/BG,CA+BH,KA/BG,CAJP,C;EAsCZ,C;0CAKCiC,CAAAA,EAA2B;A,IAAU,OAAT,W;EAAS,C;0CAErCC,CAAAA,EAAA;A,IAAA,iB;EAGwB,C;;;;;;;;;;"}
package/arg2p-core.js CHANGED
@@ -83,15 +83,15 @@
83
83
  var mguAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.b;
84
84
  var solverOf = kotlin_it_unibo_tuprolog_dsl_solve.$_$.a;
85
85
  var unifyAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.c;
86
- var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
87
- var BaseLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.e;
88
- var LogicProgrammingScopeWithResolution = kotlin_it_unibo_tuprolog_dsl_solve.$_$.c;
89
- var LogicProgrammingScopeWithPrologStandardLibrary = kotlin_it_unibo_tuprolog_dsl_core.$_$.h4;
90
- var LogicProgrammingScopeWithTheories = kotlin_it_unibo_tuprolog_dsl_theory.$_$.h;
91
- var LogicProgrammingScopeWithSubstitutions = kotlin_it_unibo_tuprolog_dsl_core.$_$.o4;
92
86
  var LogicProgrammingScopeWithOperators = kotlin_it_unibo_tuprolog_dsl_core.$_$.w1;
87
+ var LogicProgrammingScopeWithTheories = kotlin_it_unibo_tuprolog_dsl_theory.$_$.h;
88
+ var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
93
89
  var Scope = kotlin_it_unibo_tuprolog_core.$_$.r1;
90
+ var LogicProgrammingScopeWithPrologStandardLibrary = kotlin_it_unibo_tuprolog_dsl_core.$_$.h4;
91
+ var LogicProgrammingScopeWithResolution = kotlin_it_unibo_tuprolog_dsl_solve.$_$.c;
94
92
  var LogicProgrammingScopeWithUnification = kotlin_it_unibo_tuprolog_dsl_unify.$_$.j;
93
+ var BaseLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.e;
94
+ var LogicProgrammingScopeWithSubstitutions = kotlin_it_unibo_tuprolog_dsl_core.$_$.o4;
95
95
  var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.i;
96
96
  var lazy = kotlin_kotlin.$_$.ea;
97
97
  var KProperty1 = kotlin_kotlin.$_$.w6;
@@ -220,7 +220,7 @@
220
220
  setMetadataFor(Arg2pSolver$Companion$of$1, VOID, classMeta, VOID, [Arg2pSolver]);
221
221
  setMetadataFor(Companion, 'Companion', objectMeta);
222
222
  setMetadataFor(Arg2pSolverFactory, 'Arg2pSolverFactory', objectMeta);
223
- setMetadataFor(PrologWithArgumentationImpl, 'PrologWithArgumentationImpl', classMeta, VOID, [MinimalLogicProgrammingScope, BaseLogicProgrammingScope, LogicProgrammingScopeWithResolution, LogicProgrammingScopeWithPrologStandardLibrary, LogicProgrammingScopeWithTheories, LogicProgrammingScopeWithSubstitutions, LogicProgrammingScopeWithOperators, Scope, LogicProgrammingScopeWithUnification], PrologWithArgumentationImpl);
223
+ setMetadataFor(PrologWithArgumentationImpl, 'PrologWithArgumentationImpl', classMeta, VOID, [LogicProgrammingScopeWithOperators, LogicProgrammingScopeWithTheories, MinimalLogicProgrammingScope, Scope, LogicProgrammingScopeWithPrologStandardLibrary, LogicProgrammingScopeWithResolution, LogicProgrammingScopeWithUnification, BaseLogicProgrammingScope, LogicProgrammingScopeWithSubstitutions], PrologWithArgumentationImpl);
224
224
  function get_theoryOperators() {
225
225
  return Companion_getInstance_1().DEFAULT;
226
226
  }
@@ -4516,7 +4516,7 @@
4516
4516
  return ArgumentationGraph_instance;
4517
4517
  }
4518
4518
  function AttackRelation() {
4519
- this.o3o_1 = 'attacks(rebut, A, B) :- rebuts(A, B), !.\nattacks(contrary_rebut, A, B) :- contraryRebuts(A, B), !.\nattacks(undermine, A, B) :- undermines(A, B), !.\nattacks(contrary_undermine, A, B) :- contraryUndermines(A, B), !.\nattacks(undercut, A, B) :- undercuts(A, B), !.\nexpanded_conflict(HeadA, HeadB) :-\n parser::classic_conflict(HeadA, HeadB).\nexpanded_conflict(HeadA, HeadB) :-\n parser::classic_conflict(HeadA, HeadB, Guard),\n (callable(Guard) -> call(Guard); Guard).\nrebuts([IDPremisesA, RuleA, RuleHeadA, _, _], [IDPremisesB, RuleB, RuleHeadB, _, Info]) :-\n\tRuleB \\== none,\n Info \\== [[], [], []],\n\texpanded_conflict(RuleHeadA, RuleHeadB).\ncontraryRebuts([IDPremisesA, RuleA, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n\tRuleA \\== none,\n\tRuleB \\== none,\n\tutils::contains(~(RuleHeadA), Body).\nundermines([IDPremisesA, RuleA, RuleHeadA, _, _], [[IDPremiseB], none, RuleHeadB, _, Info]) :-\n\tInfo \\== [[], [], []],\n\texpanded_conflict(RuleHeadA, RuleHeadB).\ncontraryUndermines([IDPremisesA, none, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n\tRuleB \\== none,\n\tutils::contains(~(RuleHeadA), Body).\nundercuts([_, _, [undercut(RuleB)], _, _], [_, RuleB, _, _, [[RuleB], _, _]]).\nundercuts([_, _, NegRuleB, _, _], [_, RuleB, _, _, [[RuleB], _, _]]) :-\n expanded_conflict(NegRuleB, [RuleB]).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n parser::classic_conflict(Conf, Head, Guard).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n parser::classic_conflict(Conf, Head).\nfindPossibleAttackers([_, _, _, Prem, _], [Conf]) :-\n member(~(Conf), Prem).\nfindPossibleAttackers([_, RuleID, _, _, _], [undercut(RuleID)]).\nfindPossibleAttackers([_, RuleID, _, _, _], Conf) :-\n parser::classic_conflict(Conf, [RuleID], Guard).\nfindPossibleAttackers([_, RuleID, _, _, _], Conf) :-\n parser::classic_conflict(Conf, [RuleID]).\nconflict([Atom], [-Atom], (Atom \\= -_)).\nconflict([-Atom], [Atom]).\nconflict([o(Atom)], [o(-Atom)], (Atom \\= -_)).\nconflict([o(-Atom)], [o(Atom)]).\nconflict([p(Atom)], [o(-Atom)], (Atom \\= -_)).\nconflict([o(-Atom)], [p(Atom)]).\nconflict([p(-Atom)], [o(Atom)]).\nconflict([o(Atom)], [p(-Atom)], (Atom \\= -_)).\nconflict([sup(X, Y)], [sup(Y, X)]).';
4519
+ this.o3o_1 = 'attacks(rebut, A, B) :- rebuts(A, B), !.\nattacks(contrary_rebut, A, B) :- contraryRebuts(A, B), !.\nattacks(undermine, A, B) :- undermines(A, B), !.\nattacks(contrary_undermine, A, B) :- contraryUndermines(A, B), !.\nattacks(undercut, A, B) :- undercuts(A, B), !.\nexpanded_conflict(HeadA, HeadB) :-\n parser::classic_conflict(HeadA, HeadB).\nexpanded_conflict(HeadA, HeadB) :-\n parser::classic_conflict(HeadA, HeadB, Guard),\n (callable(Guard) -> call(Guard); Guard).\nrebuts([IDPremisesA, RuleA, RuleHeadA, _, _], [IDPremisesB, RuleB, RuleHeadB, _, Info]) :-\n\tRuleB \\== none,\n Info \\== [[], [], []],\n\texpanded_conflict(RuleHeadA, RuleHeadB).\ncontraryRebuts([IDPremisesA, RuleA, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n\tRuleA \\== none,\n\tRuleB \\== none,\n\tutils::contains(~(RuleHeadA), Body).\nundermines([IDPremisesA, RuleA, RuleHeadA, _, _], [[IDPremiseB], none, RuleHeadB, _, Info]) :-\n\tInfo \\== [[], [], []],\n\texpanded_conflict(RuleHeadA, RuleHeadB).\ncontraryUndermines([IDPremisesA, none, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n\tRuleB \\== none,\n\tutils::contains(~(RuleHeadA), Body).\nundercuts([_, _, [undercut(RuleB)], _, _], [_, RuleB, _, _, [[RuleB], _, _]]).\nundercuts([_, _, NegRuleB, _, _], [_, RuleB, _, _, [[RuleB], _, _]]) :-\n expanded_conflict(NegRuleB, [RuleB]).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n parser::classic_conflict(Conf, Head, Guard).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n parser::classic_conflict(Conf, Head).\nfindPossibleAttackers([_, _, _, Prem, _], [Conf]) :-\n member(~(Conf), Prem).\nfindPossibleAttackers([_, RuleID, _, _, _], [undercut(RuleID)]).\nfindPossibleAttackers([_, RuleID, _, _, _], Conf) :-\n parser::classic_conflict(Conf, [RuleID], Guard).\nfindPossibleAttackers([_, RuleID, _, _, _], Conf) :-\n parser::classic_conflict(Conf, [RuleID]).';
4520
4520
  }
4521
4521
  var AttackRelation_instance;
4522
4522
  function AttackRelation_getInstance() {
@@ -4614,7 +4614,7 @@
4614
4614
  return QueryMode_instance_0;
4615
4615
  }
4616
4616
  function RuleTranslator() {
4617
- this.n3o_1 = "/*\n * Main directive. Find all the rules in the theory in the format (Name : Preconditions => Conclusion)\n * or (Name : Effects) and then if:\n * - It is a standard rule, translate it in the standard format (rule([Name, Preconditions, Conclusions]));\n * - It is a bp rule, translate it to (abstractBp([Effects]))\n * During the process, clean them from the unallowed symbols (-, o, p).\n */\nconvertAllRules(ArgRules) :-\n defeasibleRules(DefeasibleRules),\n strictRules(StrictRules, RulesIds),\n ordinaryPremises(Premises),\n axiomPremises(Axioms, AxiomsIds),\n specialRules(SpecialRules),\n utils::appendLists([DefeasibleRules, StrictRules, Premises, Axioms], Rules),\n rule_to_clause(Rules, Clauses),\n findall(sup(X, Y), sup(X, Y), Sup),\n utils::appendLists([Clauses, AxiomsIds, RulesIds, Sup, SpecialRules], ArgRules),\n utils::assert_all(ArgRules), !.\ndefeasibleRules(DefeasibleRules) :-\n findall([RuleName, Preconditions, Effect], (RuleName : Preconditions => Effect), DefeasibleRulesOld),\n prologDefeasibleRules(DefeasibleRulesNew),\n utils::append_fast(DefeasibleRulesOld, DefeasibleRulesNew, DefeasibleRules).\nstrictRules(CtrRules, Ids) :-\n findall([RuleName, Preconditions, Effect], (RuleName : Preconditions -> Effect), StrictRulesOld),\n prologStrictRules(StrictRulesNew),\n utils::append_fast(StrictRulesOld, StrictRulesNew, StrictRules),\n transpose(StrictRules, StrictRules, CtrRules),\n extract_id(CtrRules, Ids).\nordinaryPremises(Premises) :-\n findall([RuleName, Effect], ((RuleName :=> Effect), atom(RuleName)), PremisesOld),\n prologPremises(PremisesNew),\n utils::append_fast(PremisesOld, PremisesNew, Premises).\naxiomPremises(Axioms, Ids) :-\n findall([RuleName, Effect], ((RuleName :-> Effect), atom(RuleName)), AxiomsOld),\n prologAxioms(AxiomsNew),\n utils::append_fast(AxiomsOld, AxiomsNew, Axioms),\n extract_id(Axioms, Ids).\nspecialRules(SpecialRules) :-\n bpsNew(SpecialRules).\ntranspose(_, CtrRules, CtrRules) :- \\+ autoTransposition, !.\ntranspose([], CtrRules, CtrRules).\ntranspose([H|T], TempCtrRules, CtrRules) :-\n transpose(T, TempCtrRules, CR),\n findall(TrH, transposition(H, TrH), Tran),\n mergeCtrRules(CR, Tran, CtrRules).\nmergeCtrRules(All, ToMerge, X) :-\n utils::append_fast(All, ToMerge, XT),\n deduplicate(XT, X).\ndeduplicate([], []).\ndeduplicate([[RN,A,B]|T], X) :- deduplicate(T, TT), (member([RN,_,_], TT) -> X = TT; X = [[RN,A,B]|TT]). \ntransposition([Id, Prec, Effect], [Id, Prec, Effect]).\ntransposition([Id, Prec, Effect], [NewId, NewPrec ,XNegated]) :-\n compound(Prec),\n tuple_to_list(Prec, LPrec),!,\n transposition_sequential(LPrec, LPrec, Effect, Id, [], NewPrec, XNegated, NewId).\ntransposition([Id, Prec, Effect], [NewId, EffectNegated ,XNegated]) :-\n \\+ compound(Prec),\n Prec \\== [],\n prologEscape(Prec),\n negate(Prec, XNegated),\n negate(Effect, EffectNegated),\n atom_concat(Id, '_i', NewId).\ntransposition_sequential(LPrec, [H|T], Effect, Id, Skipped, NewPrec, XNegated, NewId) :-\n transposition_sequential(LPrec, T, Effect, Id, [H|Skipped], NewPrec, XNegated, NewId).\ntransposition_sequential(LPrec, [X|T], Effect, Id, Skipped, NewPrec, XNegated, NewId) :-\n prologEscape(X),\n utils::append_fast(Skipped, T, CleanedPrec),\n negate(X, XNegated),\n negate(Effect, EffectNegated),\n list_to_tuple([EffectNegated|CleanedPrec], NewPrec),\n newIdentifier(Skipped, Id, NewId).\nnewIdentifier(List, OldId, NewId) :-\n modifier(List, Mod),\n atom_concat(OldId, Mod, NewId).\nmodifier([], '_i').\nmodifier([_|Tail], Index):-\n modifier(Tail, Index1),\n atom_concat(Index1, 'i', Index).\nnegate(X, Arg) :-\n functor(X, '-', _) -> (\n arg(1, X, Arg));\n functor(X, 'p', _) -> (\n arg(1, X, PX),\n (functor(PX, '-', _) -> (\n arg(1, PX, PNX),\n Arg = o(PNX)\n );\n Arg = o(-(PX))));\n Arg = -(X).\nprologEscape(X) :- \\+ functor(X, 'prolog', _), \\+ functor(X, '~', _).\n/*\n * Standard rules (RuleName : Preconditions => Effects)\n * Special rules (RuleName : Effects)\n */\nconvertAllRules([], []).\nconvertAllRules([[H,P,E]|T], [R|Rules]) :- convertRule(H, P, E, R), convertAllRules(T, Rules).\nconvertAllRules([[H,E]|T], [R|Rules]) :- convertRule(H, E, R), convertAllRules(T, Rules).\n/*\n * Convert the given rule to the standard format\n * Example:\n * r2: followedGuidelines(X), doctor(X) => -liable(X)\n * rule([r2,[[followedGuidelines(X_e4149)],[doctor(X_e4149)]],[neg,liable(X_e4149)]]).\n */\nconvertRule(RuleName, Preconditions, Effects, rule(List)) :-\n tuple_to_list(Preconditions, Lprecond),\n tuple_to_list(Effects, Leffects),\n check_modifiers_in_list(preconditions, Lprecond, LprecondChecked),\n check_modifiers_in_list(effects, Leffects, LeffectsChecked),\n flatten_first_level(LeffectsChecked, LeffectsCheckedFlattened),\n List = [RuleName, LprecondChecked, LeffectsCheckedFlattened], !.\n/*\n * Convert the given special rule\n * Example:\n * bp(-liable(X)).\n * abastractBp([[neg, liable(X_e4149)]]).\n */\nconvertRule(bps, Effects, abstractBp(Checked)) :-\n functor(Effects, 'bp', _),\n Effects =.. L,\n removehead(L, LC),\n check_modifiers_in_list(effects, LC, Checked), !.\nconvertRule(Name, Effects, premise([Name, LeffectsCheckedFlattened])) :-\n tuple_to_list(Effects, Leffects),\n check_modifiers_in_list(effects, Leffects, LeffectsChecked),\n flatten_first_level(LeffectsChecked, LeffectsCheckedFlattened).\n/*\n * Find negations(-), obligations(o), permissions(p) on a list of preconditions/effects and\n * raplace them with the assigned literal (neg, obl, perm)\n */\ncheck_modifiers_in_list(MODE, [], []) :- !.\ncheck_modifiers_in_list(MODE, [H|T], L) :- H == [], L = [], !.\ncheck_modifiers_in_list(MODE, [H|T], R) :- H \\== [],\n check_modifiers_once(H, LH),\n check_modifiers_in_list(MODE, T, LT),\n utils::append_fast([LH], LT, L),\n R = L.\ncheck_modifiers_once(H, List) :- once(check_modifiers(H, List)).\ncheck_modifiers([], []).\ncheck_modifiers(H, List) :-\n functor(H, '-', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lobl),\n utils::append_fast([neg], Lobl, Lf),\n List = Lf);\n functor(H, 'o', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lobl),\n List = [obl|[Lobl]]);\n functor(H, 'p', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lper),\n List = [perm|[Lper]]);\n functor(H, '~', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lper),\n List = [unless|[Lper]]);\n functor(H, 'bp', _) -> (\n H =.. [_|Arg],\n check_modifiers_in_list(effects, Arg, Lper),\n List = [bp|[Lper]]);\n List = [H].\nlist_to_tuple([H], (H)) :- !.\nlist_to_tuple([H|T], (H,TT)) :- list_to_tuple(T,TT).\n/*\n * Replace all the occurences of a given element with the given argument\n */\nreplace(_, _, [],[]) :- !.\nreplace(O, R, [O|T], [R|T2]) :- replace(O, R, T, T2), !.\nreplace(O, R, [H|T], [H|T2]) :- H \\= O, replace(O, R, T, T2).\nflatten_first_level([X], X) :- !.\nflatten_first_level.\nremovehead([_|Tail], Tail).\nin(A, A) :- nonvar(A), A \\= (_ , _), !.\nin(A, (A, _)) :- !.\nin(A, (_ , Cs)) :- in(A, Cs).\ncheck_admissibility(preconditions, H, LH) :-\n \\+ defeasible_admissible(LH),\n throw(['Premise ', H, ' is not a well formed member of the argumentation language.']).\ncheck_admissibility(effects, H, LH) :-\n \\+ admissible(LH),\n throw(['Conclusion ', H, ' is not a well formed member of the argumentation language.']).\ncheck_admissibility(_, _, _).\ndefeasible_admissible([unless, Term]) :- admissible(Term).\ndefeasible_admissible(Term) :- admissible(Term).\nadmissible([neg, bp, Term]) :- admissible_terms_complete(Term).\nadmissible([bp, Term]) :- admissible_terms_complete(Term).\nadmissible([neg, Term]) :- admissible_term(Term).\nadmissible([obl, [Term]]) :- admissible_term(Term).\nadmissible([obl, [neg, Term]]) :- admissible_term(Term).\nadmissible([neg, obl, [Term]]) :- admissible_term(Term).\nadmissible([neg, obl, [neg, Term]]) :- admissible_term(Term).\nadmissible([perm, [Term]]) :- admissible_term(Term).\nadmissible([perm, [neg, Term]]) :- admissible_term(Term).\nadmissible([Term]) :- admissible_term(Term).\nadmissible_term(Term) :-\n atomic(Term),\n Term \\== neg,\n Term \\== obl,\n Term \\== perm,\n Term \\== unless,\n Term \\== bp.\nadmissible_term(Term) :- var(Term).\nadmissible_term(Term) :-\n compound(Term),\n \\+ functor(Term, 'o', _),\n \\+ functor(Term, 'p', _),\n \\+ functor(Term, '-', _),\n \\+ functor(Term, '~', _),\n \\+ functor(Term, 'bp', _),\n Term =.. [_|Args],\n admissible_terms(Args).\nadmissible_terms([]).\nadmissible_terms([H|T]) :-\n admissible_term(H),\n admissible_terms(T).\nadmissible_terms_complete([]).\nadmissible_terms_complete([H|T]) :-\n admissible(H),\n admissible_terms_complete(T).\nrule(Id, PP, [Conclusion]) :- context_check(clause(rl(Conclusion), [Id, Premises, Conclusion])), tuple_to_list(Premises, P), ff(P, PP).\npremise(Id, [Conclusion]) :- context_check(clause(rl(Conclusion), [Id, Conclusion])).\ncheck_strict(Id) :- context_check(strict(Id)).\nprolog([prolog(Term)], Term).\ncontrary([~(Term)], Term).\nundercut(undercut(Rule), Rule).\nsuperiority(sup(Id1, Id2), Id1, Id2).\n/*\n * Convert the given tuple to list\n */\ntuple_to_list(A,[A]) :- nonvar(A), A \\= (_ , _), !.\ntuple_to_list((A,B),L) :-\n tuple_to_list(A, La),\n tuple_to_list(B, Lb),\n utils::append_fast(La, Lb,L).\nff([[]], []) :- !.\nff([[X]], [X]) :- !.\nff(X, X).\nclassic_rule(X, [applicable(X)|Y], Z) :- metaRules, !, rule(X, Y, Z).\nclassic_rule(X, Y, Z) :- rule(X, Y, Z).\nclassic_rule(X, Y) :- premise(X, Y).\nclassic_conflict([A], [B], C) :- metaConflicts,\n context_check(clause(conc([conflict(A, B, C)]), _)).\nclassic_conflict([A], [B]) :- metaConflicts,\n context_check(clause(conc([conflict(A, B)]), _)).\nclassic_conflict(A, B, C) :-\n \\+ metaConflicts,\n member(conflict(A, B, C), [\n conflict([Atom], [-Atom], (Atom \\= -_)),\n conflict([-Atom], [Atom], true),\n conflict([o(Atom)], [o(-Atom)], (Atom \\= -_)),\n conflict([o(-Atom)], [o(Atom)], true),\n conflict([p(Atom)], [o(-Atom)], (Atom \\= -_)),\n conflict([o(-Atom)], [p(Atom)], true),\n conflict([p(-Atom)], [o(Atom)], true),\n conflict([o(Atom)], [p(-Atom)], (Atom \\= -_)),\n conflict([sup(X, Y)], [sup(Y, X)], true)\n ]).";
4617
+ this.n3o_1 = "/*\n * Main directive. Find all the rules in the theory in the format (Name : Preconditions => Conclusion)\n * or (Name : Effects) and then if:\n * - It is a standard rule, translate it in the standard format (rule([Name, Preconditions, Conclusions]));\n * - It is a bp rule, translate it to (abstractBp([Effects]))\n * During the process, clean them from the unallowed symbols (-, o, p).\n */\nconvertAllRules(ArgRules) :-\n defeasibleRules(DefeasibleRules),\n strictRules(StrictRules, RulesIds),\n ordinaryPremises(Premises),\n axiomPremises(Axioms, AxiomsIds),\n specialRules(SpecialRules),\n utils::appendLists([DefeasibleRules, StrictRules, Premises, Axioms], Rules),\n rule_to_clause(Rules, Clauses),\n findall(sup(X, Y), sup(X, Y), Sup),\n utils::appendLists([Clauses, AxiomsIds, RulesIds, Sup, SpecialRules], ArgRules),\n utils::assert_all(ArgRules), !.\ndefeasibleRules(DefeasibleRules) :-\n findall([RuleName, Preconditions, Effect], (RuleName : Preconditions => Effect), DefeasibleRulesOld),\n prologDefeasibleRules(DefeasibleRulesNew),\n utils::append_fast(DefeasibleRulesOld, DefeasibleRulesNew, DefeasibleRules).\nstrictRules(CtrRules, Ids) :-\n findall([RuleName, Preconditions, Effect], (RuleName : Preconditions -> Effect), StrictRulesOld),\n prologStrictRules(StrictRulesNew),\n utils::append_fast(StrictRulesOld, StrictRulesNew, StrictRules),\n transpose(StrictRules, StrictRules, CtrRules),\n extract_id(CtrRules, Ids).\nordinaryPremises(Premises) :-\n findall([RuleName, Effect], ((RuleName :=> Effect), atom(RuleName)), PremisesOld),\n prologPremises(PremisesNew),\n utils::append_fast(PremisesOld, PremisesNew, Premises).\naxiomPremises(Axioms, Ids) :-\n findall([RuleName, Effect], ((RuleName :-> Effect), atom(RuleName)), AxiomsOld),\n prologAxioms(AxiomsNew),\n utils::append_fast(AxiomsOld, AxiomsNew, Axioms),\n extract_id(Axioms, Ids).\nspecialRules(SpecialRules) :-\n bpsNew(SpecialRules).\ntranspose(_, CtrRules, CtrRules) :- \\+ autoTransposition, !.\ntranspose([], CtrRules, CtrRules).\ntranspose([H|T], TempCtrRules, CtrRules) :-\n transpose(T, TempCtrRules, CR),\n findall(TrH, transposition(H, TrH), Tran),\n mergeCtrRules(CR, Tran, CtrRules).\nmergeCtrRules(All, ToMerge, X) :-\n utils::append_fast(All, ToMerge, XT),\n deduplicate(XT, X).\ndeduplicate([], []).\ndeduplicate([[RN,A,B]|T], X) :- deduplicate(T, TT), (member([RN,_,_], TT) -> X = TT; X = [[RN,A,B]|TT]). \ntransposition([Id, Prec, Effect], [Id, Prec, Effect]).\ntransposition([Id, Prec, Effect], [NewId, NewPrec ,XNegated]) :-\n compound(Prec),\n tuple_to_list(Prec, LPrec),!,\n transposition_sequential(LPrec, LPrec, Effect, Id, [], NewPrec, XNegated, NewId).\ntransposition([Id, Prec, Effect], [NewId, EffectNegated ,XNegated]) :-\n \\+ compound(Prec),\n Prec \\== [],\n prologEscape(Prec),\n negate(Prec, XNegated),\n negate(Effect, EffectNegated),\n atom_concat(Id, '_i', NewId).\ntransposition_sequential(LPrec, [H|T], Effect, Id, Skipped, NewPrec, XNegated, NewId) :-\n transposition_sequential(LPrec, T, Effect, Id, [H|Skipped], NewPrec, XNegated, NewId).\ntransposition_sequential(LPrec, [X|T], Effect, Id, Skipped, NewPrec, XNegated, NewId) :-\n prologEscape(X),\n utils::append_fast(Skipped, T, CleanedPrec),\n negate(X, XNegated),\n negate(Effect, EffectNegated),\n list_to_tuple([EffectNegated|CleanedPrec], NewPrec),\n newIdentifier(Skipped, Id, NewId).\nnewIdentifier(List, OldId, NewId) :-\n modifier(List, Mod),\n atom_concat(OldId, Mod, NewId).\nmodifier([], '_i').\nmodifier([_|Tail], Index):-\n modifier(Tail, Index1),\n atom_concat(Index1, 'i', Index).\nnegate(X, Arg) :-\n functor(X, '-', _) -> (\n arg(1, X, Arg));\n functor(X, 'p', _) -> (\n arg(1, X, PX),\n (functor(PX, '-', _) -> (\n arg(1, PX, PNX),\n Arg = o(PNX)\n );\n Arg = o(-(PX))));\n Arg = -(X).\nprologEscape(X) :- \\+ functor(X, 'prolog', _), \\+ functor(X, '~', _).\n/*\n * Standard rules (RuleName : Preconditions => Effects)\n * Special rules (RuleName : Effects)\n */\nconvertAllRules([], []).\nconvertAllRules([[H,P,E]|T], [R|Rules]) :- convertRule(H, P, E, R), convertAllRules(T, Rules).\nconvertAllRules([[H,E]|T], [R|Rules]) :- convertRule(H, E, R), convertAllRules(T, Rules).\n/*\n * Convert the given rule to the standard format\n * Example:\n * r2: followedGuidelines(X), doctor(X) => -liable(X)\n * rule([r2,[[followedGuidelines(X_e4149)],[doctor(X_e4149)]],[neg,liable(X_e4149)]]).\n */\nconvertRule(RuleName, Preconditions, Effects, rule(List)) :-\n tuple_to_list(Preconditions, Lprecond),\n tuple_to_list(Effects, Leffects),\n check_modifiers_in_list(preconditions, Lprecond, LprecondChecked),\n check_modifiers_in_list(effects, Leffects, LeffectsChecked),\n flatten_first_level(LeffectsChecked, LeffectsCheckedFlattened),\n List = [RuleName, LprecondChecked, LeffectsCheckedFlattened], !.\n/*\n * Convert the given special rule\n * Example:\n * bp(-liable(X)).\n * abastractBp([[neg, liable(X_e4149)]]).\n */\nconvertRule(bps, Effects, abstractBp(Checked)) :-\n functor(Effects, 'bp', _),\n Effects =.. L,\n removehead(L, LC),\n check_modifiers_in_list(effects, LC, Checked), !.\nconvertRule(Name, Effects, premise([Name, LeffectsCheckedFlattened])) :-\n tuple_to_list(Effects, Leffects),\n check_modifiers_in_list(effects, Leffects, LeffectsChecked),\n flatten_first_level(LeffectsChecked, LeffectsCheckedFlattened).\n/*\n * Find negations(-), obligations(o), permissions(p) on a list of preconditions/effects and\n * raplace them with the assigned literal (neg, obl, perm)\n */\ncheck_modifiers_in_list(MODE, [], []) :- !.\ncheck_modifiers_in_list(MODE, [H|T], L) :- H == [], L = [], !.\ncheck_modifiers_in_list(MODE, [H|T], R) :- H \\== [],\n check_modifiers_once(H, LH),\n check_modifiers_in_list(MODE, T, LT),\n utils::append_fast([LH], LT, L),\n R = L.\ncheck_modifiers_once(H, List) :- once(check_modifiers(H, List)).\ncheck_modifiers([], []).\ncheck_modifiers(H, List) :-\n functor(H, '-', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lobl),\n utils::append_fast([neg], Lobl, Lf),\n List = Lf);\n functor(H, 'o', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lobl),\n List = [obl|[Lobl]]);\n functor(H, 'p', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lper),\n List = [perm|[Lper]]);\n functor(H, '~', _) -> (\n arg(1, H, Arg),\n check_modifiers_once(Arg, Lper),\n List = [unless|[Lper]]);\n functor(H, 'bp', _) -> (\n H =.. [_|Arg],\n check_modifiers_in_list(effects, Arg, Lper),\n List = [bp|[Lper]]);\n List = [H].\nlist_to_tuple([H], (H)) :- !.\nlist_to_tuple([H|T], (H,TT)) :- list_to_tuple(T,TT).\n/*\n * Replace all the occurences of a given element with the given argument\n */\nreplace(_, _, [],[]) :- !.\nreplace(O, R, [O|T], [R|T2]) :- replace(O, R, T, T2), !.\nreplace(O, R, [H|T], [H|T2]) :- H \\= O, replace(O, R, T, T2).\nflatten_first_level([X], X) :- !.\nflatten_first_level.\nremovehead([_|Tail], Tail).\nin(A, A) :- nonvar(A), A \\= (_ , _), !.\nin(A, (A, _)) :- !.\nin(A, (_ , Cs)) :- in(A, Cs).\ncheck_admissibility(preconditions, H, LH) :-\n \\+ defeasible_admissible(LH),\n throw(['Premise ', H, ' is not a well formed member of the argumentation language.']).\ncheck_admissibility(effects, H, LH) :-\n \\+ admissible(LH),\n throw(['Conclusion ', H, ' is not a well formed member of the argumentation language.']).\ncheck_admissibility(_, _, _).\ndefeasible_admissible([unless, Term]) :- admissible(Term).\ndefeasible_admissible(Term) :- admissible(Term).\nadmissible([neg, bp, Term]) :- admissible_terms_complete(Term).\nadmissible([bp, Term]) :- admissible_terms_complete(Term).\nadmissible([neg, Term]) :- admissible_term(Term).\nadmissible([obl, [Term]]) :- admissible_term(Term).\nadmissible([obl, [neg, Term]]) :- admissible_term(Term).\nadmissible([neg, obl, [Term]]) :- admissible_term(Term).\nadmissible([neg, obl, [neg, Term]]) :- admissible_term(Term).\nadmissible([perm, [Term]]) :- admissible_term(Term).\nadmissible([perm, [neg, Term]]) :- admissible_term(Term).\nadmissible([Term]) :- admissible_term(Term).\nadmissible_term(Term) :-\n atomic(Term),\n Term \\== neg,\n Term \\== obl,\n Term \\== perm,\n Term \\== unless,\n Term \\== bp.\nadmissible_term(Term) :- var(Term).\nadmissible_term(Term) :-\n compound(Term),\n \\+ functor(Term, 'o', _),\n \\+ functor(Term, 'p', _),\n \\+ functor(Term, '-', _),\n \\+ functor(Term, '~', _),\n \\+ functor(Term, 'bp', _),\n Term =.. [_|Args],\n admissible_terms(Args).\nadmissible_terms([]).\nadmissible_terms([H|T]) :-\n admissible_term(H),\n admissible_terms(T).\nadmissible_terms_complete([]).\nadmissible_terms_complete([H|T]) :-\n admissible(H),\n admissible_terms_complete(T).\nrule(Id, PP, [Conclusion]) :- context_check(clause(rl(Conclusion), [Id, Premises, Conclusion])), tuple_to_list(Premises, P), ff(P, PP).\npremise(Id, [Conclusion]) :- context_check(clause(rl(Conclusion), [Id, Conclusion])).\ncheck_strict(Id) :- context_check(strict(Id)).\nprolog([prolog(Term)], Term).\ncontrary([~(Term)], Term).\nundercut(undercut(Rule), Rule).\nsuperiority(sup(Id1, Id2), Id1, Id2).\n/*\n * Convert the given tuple to list\n */\ntuple_to_list(A,[A]) :- nonvar(A), A \\= (_ , _), !.\ntuple_to_list((A,B),L) :-\n tuple_to_list(A, La),\n tuple_to_list(B, Lb),\n utils::append_fast(La, Lb,L).\nff([[]], []) :- !.\nff([[X]], [X]) :- !.\nff(X, X).\nclassic_rule(X, [applicable(X)|Y], Z) :- metaRules, !, rule(X, Y, Z).\nclassic_rule(X, Y, Z) :- rule(X, Y, Z).\nclassic_rule(X, Y) :- premise(X, Y).\nclassic_conflict([A], [B], C) :- metaConflicts,\n context_check(clause(conc([conflict(A, B, C)]), _)).\nclassic_conflict([A], [B]) :- metaConflicts,\n context_check(clause(conc([conflict(A, B)]), _)).\nclassic_conflict(A, B, C) :-\n \\+ metaConflicts,\n member(conflict(A, B, C), [\n conflict([Atom], [-Atom], (Atom \\= -_)),\n conflict([-Atom], [Atom], true),\n conflict([o(Atom)], [o(-Atom)], (Atom \\= -_)),\n conflict([o(-Atom)], [o(Atom)], true),\n conflict([p(Atom)], [o(-Atom)], (Atom \\= -_)),\n conflict([o(-Atom)], [p(Atom)], true),\n conflict([p(-Atom)], [o(Atom)], true),\n conflict([o(Atom)], [p(-Atom)], (Atom \\= -_)),\n conflict([sup(X, Y)], [sup(Y, X)], true)\n ]).\nclassic_conflict(A, B, C) :-\n \\+ metaConflicts,\n conflict(A, B, C).\nclassic_conflict(A, B) :-\n \\+ metaConflicts,\n conflict(A, B).";
4618
4618
  }
4619
4619
  var RuleTranslator_instance;
4620
4620
  function RuleTranslator_getInstance() {