@tuprolog/arg2p-core 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 +100 -89
- package/kotlin-kotlin-stdlib.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,120 +1,131 @@
|
|
|
1
1
|
# Arg2P
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
12
|
+
Arg2p is available as a [2P-Kt](http://pika-lab.gitlab.io/tuprolog/2p-kt/) library.
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
#### JVM Library - Gradle
|
|
18
15
|
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
By either pressing <kbd>Enter</kbd> while the cursor is on the query text field, or by clicking on the <kbd>></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>></kbd> over and over again.
|
|
46
|
-
One may also compute all the unexplored solutions at once by clicking on the <kbd>>></kbd> button.
|
|
83
|
+
---
|
|
47
84
|
|
|
48
|
-
|
|
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>></kbd>.
|
|
85
|
+
## Arg2p IDE
|
|
51
86
|
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
90
|
+

|
|
58
91
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
105
|
+
### Features
|
|
75
106
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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>></kbd>.
|
|
108
|
+
- **Solution Exploration:** Click <kbd>></kbd> for the next solution or <kbd>>></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
|
-
|
|
111
|
+
### Additional Tabs
|
|
84
112
|
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
116
|
+
---
|
|
96
117
|
|
|
97
|
-
|
|
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
|
-
|
|
120
|
+
Try Arg2P directly in your browser using the [Web Playground](https://legalmachinelab.unibo.it/arg2p).
|
|
107
121
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"@tuprolog/arg2p-core": "^ARG2P_MODULE_VERSION"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
It functions the same as the Java IDE, offering an interactive experience without installation.
|
|
125
|
+
|
|
126
|
+
---
|
|
117
127
|
|
|
118
|
-
|
|
128
|
+
## Issue tracking
|
|
119
129
|
|
|
120
|
-
If you
|
|
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!
|
package/kotlin-kotlin-stdlib.js
CHANGED
|
@@ -80,7 +80,7 @@ if (typeof Math.imul === 'undefined') {
|
|
|
80
80
|
setMetadataFor(Collection, 'Collection', interfaceMeta);
|
|
81
81
|
setMetadataFor(AbstractCollection, 'AbstractCollection', classMeta, VOID, [Collection]);
|
|
82
82
|
setMetadataFor(MutableIterable, 'MutableIterable', interfaceMeta);
|
|
83
|
-
setMetadataFor(AbstractMutableCollection, 'AbstractMutableCollection', classMeta, AbstractCollection, [AbstractCollection,
|
|
83
|
+
setMetadataFor(AbstractMutableCollection, 'AbstractMutableCollection', classMeta, AbstractCollection, [AbstractCollection, Collection, MutableIterable]);
|
|
84
84
|
setMetadataFor(IteratorImpl, 'IteratorImpl', classMeta);
|
|
85
85
|
setMetadataFor(ListIteratorImpl, 'ListIteratorImpl', classMeta, IteratorImpl);
|
|
86
86
|
setMetadataFor(List, 'List', interfaceMeta, VOID, [Collection]);
|
|
@@ -91,19 +91,19 @@ if (typeof Math.imul === 'undefined') {
|
|
|
91
91
|
setMetadataFor(AbstractMap, 'AbstractMap', classMeta, VOID, [Map_0]);
|
|
92
92
|
setMetadataFor(AbstractMutableMap, 'AbstractMutableMap', classMeta, AbstractMap, [AbstractMap, Map_0]);
|
|
93
93
|
setMetadataFor(Set, 'Set', interfaceMeta, VOID, [Collection]);
|
|
94
|
-
setMetadataFor(AbstractMutableSet, 'AbstractMutableSet', classMeta, AbstractMutableCollection, [AbstractMutableCollection,
|
|
94
|
+
setMetadataFor(AbstractMutableSet, 'AbstractMutableSet', classMeta, AbstractMutableCollection, [AbstractMutableCollection, Collection, Set, MutableIterable]);
|
|
95
95
|
setMetadataFor(Companion, 'Companion', objectMeta);
|
|
96
96
|
setMetadataFor(ArrayList, 'ArrayList', classMeta, AbstractMutableList, [AbstractMutableList, Collection, List, MutableIterable, RandomAccess], ArrayList_init_$Create$);
|
|
97
97
|
setMetadataFor(HashMap, 'HashMap', classMeta, AbstractMutableMap, [AbstractMutableMap, Map_0], HashMap_init_$Create$);
|
|
98
|
-
setMetadataFor(HashMapKeys, 'HashMapKeys', classMeta, AbstractMutableSet, [
|
|
99
|
-
setMetadataFor(HashMapValues, 'HashMapValues', classMeta, AbstractMutableCollection, [
|
|
100
|
-
setMetadataFor(HashMapEntrySetBase, 'HashMapEntrySetBase', classMeta, AbstractMutableSet, [
|
|
98
|
+
setMetadataFor(HashMapKeys, 'HashMapKeys', classMeta, AbstractMutableSet, [Collection, Set, MutableIterable, AbstractMutableSet]);
|
|
99
|
+
setMetadataFor(HashMapValues, 'HashMapValues', classMeta, AbstractMutableCollection, [Collection, MutableIterable, AbstractMutableCollection]);
|
|
100
|
+
setMetadataFor(HashMapEntrySetBase, 'HashMapEntrySetBase', classMeta, AbstractMutableSet, [Collection, Set, MutableIterable, AbstractMutableSet]);
|
|
101
101
|
setMetadataFor(HashMapEntrySet, 'HashMapEntrySet', classMeta, HashMapEntrySetBase);
|
|
102
102
|
setMetadataFor(HashMapKeysDefault$iterator$1, VOID, classMeta);
|
|
103
103
|
setMetadataFor(HashMapKeysDefault, 'HashMapKeysDefault', classMeta, AbstractMutableSet);
|
|
104
104
|
setMetadataFor(HashMapValuesDefault$iterator$1, VOID, classMeta);
|
|
105
105
|
setMetadataFor(HashMapValuesDefault, 'HashMapValuesDefault', classMeta, AbstractMutableCollection);
|
|
106
|
-
setMetadataFor(HashSet, 'HashSet', classMeta, AbstractMutableSet, [AbstractMutableSet,
|
|
106
|
+
setMetadataFor(HashSet, 'HashSet', classMeta, AbstractMutableSet, [AbstractMutableSet, Collection, Set, MutableIterable], HashSet_init_$Create$);
|
|
107
107
|
setMetadataFor(Companion_0, 'Companion', objectMeta);
|
|
108
108
|
setMetadataFor(Itr, 'Itr', classMeta);
|
|
109
109
|
setMetadataFor(KeysItr, 'KeysItr', classMeta, Itr);
|
|
@@ -150,7 +150,7 @@ if (typeof Math.imul === 'undefined') {
|
|
|
150
150
|
setMetadataFor(InternalMap, 'InternalMap', interfaceMeta);
|
|
151
151
|
setMetadataFor(InternalHashMap, 'InternalHashMap', classMeta, VOID, [InternalMap], InternalHashMap_init_$Create$);
|
|
152
152
|
setMetadataFor(LinkedHashMap, 'LinkedHashMap', classMeta, HashMap, [HashMap, Map_0], LinkedHashMap_init_$Create$);
|
|
153
|
-
setMetadataFor(LinkedHashSet, 'LinkedHashSet', classMeta, HashSet, [HashSet,
|
|
153
|
+
setMetadataFor(LinkedHashSet, 'LinkedHashSet', classMeta, HashSet, [HashSet, Collection, Set, MutableIterable], LinkedHashSet_init_$Create$);
|
|
154
154
|
setMetadataFor(BaseOutput, 'BaseOutput', classMeta);
|
|
155
155
|
setMetadataFor(NodeJsOutput, 'NodeJsOutput', classMeta, BaseOutput);
|
|
156
156
|
setMetadataFor(BufferedOutput, 'BufferedOutput', classMeta, BaseOutput, VOID, BufferedOutput);
|