@tuprolog/arg2p-core 0.8.3 → 0.9.0
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/2p-dsl-core.js +209 -209
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +6 -6
- package/2p-dsl-theory.js +5 -5
- package/2p-parser-theory.js +4 -4
- package/2p-parser-theory.js.map +1 -1
- package/arg2p-core.js +14 -13
- package/arg2p-core.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +4 -4
- package/package.json +1 -1
package/2p-dsl-theory.js
CHANGED
|
@@ -179,13 +179,13 @@
|
|
|
179
179
|
var matchAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.a;
|
|
180
180
|
var unify = kotlin_it_unibo_tuprolog_dsl_unify.$_$.i;
|
|
181
181
|
var unifyAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.c;
|
|
182
|
-
var
|
|
183
|
-
var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
|
|
182
|
+
var LogicProgrammingScopeWithPrologStandardLibrary = kotlin_it_unibo_tuprolog_dsl_core.$_$.h4;
|
|
184
183
|
var Scope = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
185
|
-
var
|
|
184
|
+
var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
|
|
186
185
|
var LogicProgrammingScopeWithOperators = kotlin_it_unibo_tuprolog_dsl_core.$_$.w1;
|
|
187
|
-
var
|
|
186
|
+
var LogicProgrammingScopeWithSubstitutions = kotlin_it_unibo_tuprolog_dsl_core.$_$.o4;
|
|
188
187
|
var BaseLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.e;
|
|
188
|
+
var LogicProgrammingScopeWithUnification = kotlin_it_unibo_tuprolog_dsl_unify.$_$.j;
|
|
189
189
|
var Unificator = kotlin_it_unibo_tuprolog_unify.$_$.c;
|
|
190
190
|
var TheoryFactory = kotlin_it_unibo_tuprolog_theory.$_$.f;
|
|
191
191
|
var classMeta = kotlin_kotlin.$_$.e5;
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
return this.mutableTheoryOfIterable(flatten(listOf(arrayConcat([[clauses], otherClauses]))));
|
|
275
275
|
}
|
|
276
276
|
setMetadataFor(LogicProgrammingScopeWithTheories, 'LogicProgrammingScopeWithTheories', interfaceMeta, VOID, [Unificator, BaseLogicProgrammingScope, TheoryFactory]);
|
|
277
|
-
setMetadataFor(LogicProgrammingScopeImpl, 'LogicProgrammingScopeImpl', classMeta, VOID, [
|
|
277
|
+
setMetadataFor(LogicProgrammingScopeImpl, 'LogicProgrammingScopeImpl', classMeta, VOID, [LogicProgrammingScopeWithTheories, LogicProgrammingScopeWithPrologStandardLibrary, Scope, MinimalLogicProgrammingScope, LogicProgrammingScopeWithOperators, LogicProgrammingScopeWithSubstitutions, BaseLogicProgrammingScope, LogicProgrammingScopeWithUnification, Unificator, TheoryFactory]);
|
|
278
278
|
//endregion
|
|
279
279
|
function logicProgramming(unificator, function_0) {
|
|
280
280
|
unificator = unificator === VOID ? Companion_getInstance_0().p1u_1 : unificator;
|
package/2p-parser-theory.js
CHANGED
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
return defaultParser;
|
|
95
95
|
}
|
|
96
96
|
var defaultParser;
|
|
97
|
-
function parseTheory_0(_this__u8e3s4, input) {
|
|
98
|
-
_init_properties_ClausesParserExtensions_kt__ht0tet();
|
|
99
|
-
return get_defaultParser().parseTheoryWithDefaultUnificator(input);
|
|
100
|
-
}
|
|
101
97
|
function parseTheoryWithOperators_0(_this__u8e3s4, input, operators) {
|
|
102
98
|
_init_properties_ClausesParserExtensions_kt__ht0tet();
|
|
103
99
|
return get_defaultParser().parseTheoryWithOperatorsAndDefaultUnificator(input, operators);
|
|
104
100
|
}
|
|
101
|
+
function parseTheory_0(_this__u8e3s4, input) {
|
|
102
|
+
_init_properties_ClausesParserExtensions_kt__ht0tet();
|
|
103
|
+
return get_defaultParser().parseTheoryWithDefaultUnificator(input);
|
|
104
|
+
}
|
|
105
105
|
var properties_initialized_ClausesParserExtensions_kt_4rkyvt;
|
|
106
106
|
function _init_properties_ClausesParserExtensions_kt__ht0tet() {
|
|
107
107
|
if (!properties_initialized_ClausesParserExtensions_kt_4rkyvt) {
|
package/2p-parser-theory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../2p-kt/2p-kt/parser-theory/src/commonMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParser.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/commonMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserExtensions.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/jsMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserExtensions.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/jsMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserImpl.kt","common/src/generated/_Sequences.kt"],"sourcesContent":[null,null,null,null,null],"names":["parseTheory","input","operators","unificator","parseClausesLazily","parseClauses","<init>","withNoOperator","withStandardOperators","withDefaultOperators","withOperators","<get-defaultParser>","parse","<this>","<init properties ClausesParserExtensions.kt>","clausesParserWithOperators","ClausesParserImpl$parseClausesLazily$lambda","it","defaultOperatorSet","<get-defaultOperatorSet>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAeIA,CACIC,K,EACAC,S,EACAC,UAHJH,EAIY;A,IAAkE,OAA3D,qCAAU,UAAV,EAAsB,qCAAmB,KAAnB,EAA0B,SAA1B,CAAtB,C;EAA0D,C;uDAG7EA,CACIC,K,EACAC,SAFJF,EAGY;A,IAAiD,OAAjD,8BAAY,KAAZ,EAAmB,SAAnB,EAAyC,+BAAzC,C;EAAgD,C;sBAG5DA,CACIC,K,EACAE,UAFJH,EAGY;A,IAAkD,OAAlD,8BAAY,KAAZ,EAAmB,UAAnB,EAAuC,UAAvC,C;EAAiD,C;2CAG7DA,CAAgBC,KAAhBD,EAAyC;A,IAAsC,OAAtC,iBAAY,KAAZ,EAA8B,+BAA9B,C;EAAqC,C;6BAS9EI,CAAuBH,KAAvBG,EAA0D;A,IAA6C,OAA7C,qCAAmB,KAAnB,EAA0B,UAA1B,C;EAA4C,C;oCAGtGC,CACIJ,K,EACAC,SAFJG,EAGkB;A,IAA6C,OAAR,OAArC,qCAAmB,KAAnB,EAA0B,SAA1B,CAAqC,C;EAAO,C;uBAG9DA,CAAiBJ,KAAjBI,EAAgD;A,IAAuC,OAAvC,+BAAa,KAAb,EAAoB,UAApB,C;EAAsC,C;;;;oBAEtFC,CAAAA,EAAA;A,EAAA,C;+CAGIC,CAAAA,EAAuB;A,IAAgC,OAAhC,6CAA0B,KAA1B,C;EAA+B,C;sDAItDC,CAAAA,EAA8B;A,IAAmC,OAAnC,6CAA0B,QAA1B,C;EAAkC,C;qDAIhEC,CAAAA,EAA6B;A,IAAkC,OAAlC,6CAA0B,OAA1B,C;EAAiC,C;gDAI9DC,CAAkBR,SAAlBQ,EAA4C;A,IAAqC,OAArC,2BAA2B,SAA3B,C;EAAoC,C;8CAIhFA,CAAkBR,SAAlBQ,EAAgD;A,IAAsC,OAAtC,qBAAc,0BAAa,SAAD,QAAZ,CAAd,C;EAAqC,C;;;;;;;4BC7DrFC,CAAAA,EAAA;A;IAAA,oB;EAAuD,C;;
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../2p-kt/2p-kt/parser-theory/src/commonMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParser.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/commonMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserExtensions.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/jsMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserExtensions.kt","../../../../../../../../../2p-kt/2p-kt/parser-theory/src/jsMain/kotlin/it/unibo/tuprolog/theory/parsing/ClausesParserImpl.kt","common/src/generated/_Sequences.kt"],"sourcesContent":[null,null,null,null,null],"names":["parseTheory","input","operators","unificator","parseClausesLazily","parseClauses","<init>","withNoOperator","withStandardOperators","withDefaultOperators","withOperators","<get-defaultParser>","parse","<this>","<init properties ClausesParserExtensions.kt>","clausesParserWithOperators","ClausesParserImpl$parseClausesLazily$lambda","it","defaultOperatorSet","<get-defaultOperatorSet>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAeIA,CACIC,K,EACAC,S,EACAC,UAHJH,EAIY;A,IAAkE,OAA3D,qCAAU,UAAV,EAAsB,qCAAmB,KAAnB,EAA0B,SAA1B,CAAtB,C;EAA0D,C;uDAG7EA,CACIC,K,EACAC,SAFJF,EAGY;A,IAAiD,OAAjD,8BAAY,KAAZ,EAAmB,SAAnB,EAAyC,+BAAzC,C;EAAgD,C;sBAG5DA,CACIC,K,EACAE,UAFJH,EAGY;A,IAAkD,OAAlD,8BAAY,KAAZ,EAAmB,UAAnB,EAAuC,UAAvC,C;EAAiD,C;2CAG7DA,CAAgBC,KAAhBD,EAAyC;A,IAAsC,OAAtC,iBAAY,KAAZ,EAA8B,+BAA9B,C;EAAqC,C;6BAS9EI,CAAuBH,KAAvBG,EAA0D;A,IAA6C,OAA7C,qCAAmB,KAAnB,EAA0B,UAA1B,C;EAA4C,C;oCAGtGC,CACIJ,K,EACAC,SAFJG,EAGkB;A,IAA6C,OAAR,OAArC,qCAAmB,KAAnB,EAA0B,SAA1B,CAAqC,C;EAAO,C;uBAG9DA,CAAiBJ,KAAjBI,EAAgD;A,IAAuC,OAAvC,+BAAa,KAAb,EAAoB,UAApB,C;EAAsC,C;;;;oBAEtFC,CAAAA,EAAA;A,EAAA,C;+CAGIC,CAAAA,EAAuB;A,IAAgC,OAAhC,6CAA0B,KAA1B,C;EAA+B,C;sDAItDC,CAAAA,EAA8B;A,IAAmC,OAAnC,6CAA0B,QAA1B,C;EAAkC,C;qDAIhEC,CAAAA,EAA6B;A,IAAkC,OAAlC,6CAA0B,OAA1B,C;EAAiC,C;gDAI9DC,CAAkBR,SAAlBQ,EAA4C;A,IAAqC,OAArC,2BAA2B,SAA3B,C;EAAoC,C;8CAIhFA,CAAkBR,SAAlBQ,EAAgD;A,IAAsC,OAAtC,qBAAc,0BAAa,SAAD,QAAZ,CAAd,C;EAAqC,C;;;;;;;4BC7DrFC,CAAAA,EAAA;A;IAAA,oB;EAAuD,C;;qCAG/DC,CAAIC,a,EACAZ,K,EACAC,SAFJU,EAGY;A;IAA2C,OAA3C,mBAAc,8CAAY,KAAZ,EAAmB,SAAnB,C;EAA4B,C;wBAGtDA,CAAIC,a,EAAuBZ,KAA3BW,EAAoD;A;IAAgC,OAAhC,mBAAc,kCAAY,KAAZ,C;EAAiB,C;;8DArBnFE,CAAAA,E;;;sBAY0C,2C;;G;qCCRnCC,CAA+Bb,SAA/Ba,EAAsE;A,IACzE,OAAO,sBAAkB,SAAlB,C;EACX,C;sDCUiBC,CAAAC,EAAAD,EAAA;A,IAAK,OAAH,EAAG,QAAa,mBAAb,C;EAA8B,C;wDACnCA,CAAAC,EAAAD,EAAA;A,IAAK,oBAAH,EAAG,C;EAAW,C;4BARjCV,CAAwBY,kBAAxBZ,EAAA;A,IAAwB,+B;EAAxB,C;4CAAiCa,CAAAA,EAAA;A,IAAA,iB;EAAkC,C;4CACtDf,CACLH,K,EACAC,SAFKE,EAGW;A;cCON,iCAAa,KAAb,EAEhB,SAFgB,C;gBDJL,SAAI,2CAAJ,C;IAFL,OAGK,WAAI,6CAAJ,C;EACT,C;yEAEkgBH,K,EAAuBC,S;;;;;;;;;;;;;;;;;;;;;;"}
|
package/arg2p-core.js
CHANGED
|
@@ -101,15 +101,15 @@
|
|
|
101
101
|
var mguAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.b;
|
|
102
102
|
var solverOf = kotlin_it_unibo_tuprolog_dsl_solve.$_$.a;
|
|
103
103
|
var unifyAny = kotlin_it_unibo_tuprolog_dsl_unify.$_$.c;
|
|
104
|
-
var LogicProgrammingScopeWithSubstitutions = kotlin_it_unibo_tuprolog_dsl_core.$_$.o4;
|
|
105
|
-
var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
|
|
106
|
-
var Scope = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
107
104
|
var LogicProgrammingScopeWithTheories = kotlin_it_unibo_tuprolog_dsl_theory.$_$.h;
|
|
108
|
-
var LogicProgrammingScopeWithUnification = kotlin_it_unibo_tuprolog_dsl_unify.$_$.j;
|
|
109
|
-
var LogicProgrammingScopeWithOperators = kotlin_it_unibo_tuprolog_dsl_core.$_$.w1;
|
|
110
|
-
var LogicProgrammingScopeWithResolution = kotlin_it_unibo_tuprolog_dsl_solve.$_$.c;
|
|
111
105
|
var LogicProgrammingScopeWithPrologStandardLibrary = kotlin_it_unibo_tuprolog_dsl_core.$_$.h4;
|
|
106
|
+
var Scope = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
107
|
+
var MinimalLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.c5;
|
|
108
|
+
var LogicProgrammingScopeWithOperators = kotlin_it_unibo_tuprolog_dsl_core.$_$.w1;
|
|
109
|
+
var LogicProgrammingScopeWithSubstitutions = kotlin_it_unibo_tuprolog_dsl_core.$_$.o4;
|
|
112
110
|
var BaseLogicProgrammingScope = kotlin_it_unibo_tuprolog_dsl_core.$_$.e;
|
|
111
|
+
var LogicProgrammingScopeWithUnification = kotlin_it_unibo_tuprolog_dsl_unify.$_$.j;
|
|
112
|
+
var LogicProgrammingScopeWithResolution = kotlin_it_unibo_tuprolog_dsl_solve.$_$.c;
|
|
113
113
|
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.i;
|
|
114
114
|
var lazy = kotlin_kotlin.$_$.aa;
|
|
115
115
|
var KProperty1 = kotlin_kotlin.$_$.u6;
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
setMetadataFor(BridgedGraph, 'BridgedGraph', classMeta);
|
|
210
210
|
setMetadataFor(BridgedSolution, 'BridgedSolution', classMeta);
|
|
211
211
|
setMetadataFor(JsBridge, 'JsBridge', objectMeta);
|
|
212
|
-
setMetadataFor(PrologWithArgumentationImpl, 'PrologWithArgumentationImpl', classMeta, VOID, [
|
|
212
|
+
setMetadataFor(PrologWithArgumentationImpl, 'PrologWithArgumentationImpl', classMeta, VOID, [LogicProgrammingScopeWithTheories, LogicProgrammingScopeWithPrologStandardLibrary, Scope, MinimalLogicProgrammingScope, LogicProgrammingScopeWithOperators, LogicProgrammingScopeWithSubstitutions, BaseLogicProgrammingScope, LogicProgrammingScopeWithUnification, LogicProgrammingScopeWithResolution], PrologWithArgumentationImpl);
|
|
213
213
|
function get_theoryOperators() {
|
|
214
214
|
return Companion_getInstance_1().DEFAULT;
|
|
215
215
|
}
|
|
@@ -4221,6 +4221,9 @@
|
|
|
4221
4221
|
return false;
|
|
4222
4222
|
return true;
|
|
4223
4223
|
};
|
|
4224
|
+
function toString$parse(x) {
|
|
4225
|
+
return x == null ? 'none' : x;
|
|
4226
|
+
}
|
|
4224
4227
|
function Attack(attacker, target, type, on) {
|
|
4225
4228
|
type = type === VOID ? null : type;
|
|
4226
4229
|
on = on === VOID ? null : on;
|
|
@@ -4230,13 +4233,11 @@
|
|
|
4230
4233
|
this.e3c_1 = on;
|
|
4231
4234
|
}
|
|
4232
4235
|
protoOf(Attack).toString = function () {
|
|
4233
|
-
var
|
|
4234
|
-
var tmp = tmp0_elvis_lhs == null ? 'none' : tmp0_elvis_lhs;
|
|
4236
|
+
var tmp = toString(toString$parse(this.d3c_1));
|
|
4235
4237
|
var tmp_0 = this.b3c_1.t3l();
|
|
4236
4238
|
var tmp_1 = this.c3c_1.t3l();
|
|
4237
|
-
var
|
|
4238
|
-
|
|
4239
|
-
return 'attack(' + tmp + ', ' + tmp_0 + ', ' + tmp_1 + ', ' + toString(tmp2_elvis_lhs == null ? 'none' : tmp2_elvis_lhs) + ')';
|
|
4239
|
+
var tmp0_safe_receiver = this.e3c_1;
|
|
4240
|
+
return 'attack(' + tmp + ', ' + tmp_0 + ', ' + tmp_1 + ', ' + toString(toString$parse(tmp0_safe_receiver == null ? null : tmp0_safe_receiver.t3l())) + ')';
|
|
4240
4241
|
};
|
|
4241
4242
|
protoOf(Attack).hashCode = function () {
|
|
4242
4243
|
var result = this.b3c_1.hashCode();
|
|
@@ -4585,7 +4586,7 @@
|
|
|
4585
4586
|
return ArgumentationEngineInterface_instance;
|
|
4586
4587
|
}
|
|
4587
4588
|
function ArgumentationGraph() {
|
|
4588
|
-
this.f3m_1 = 'buildArgumentationGraph :-\n buildArguments,\n buildAttacks.\nbuildArguments :-\n\tbuildArgumentsFromPremises,\n\tbuildArgumentsFromEmptyRules,\n\tfindall([RuleID, RuleBody, RuleHead], (\n\t parser::classic_rule(RuleID, RuleBody, RuleHead),\n\t \\+ emptyRule([RuleID, RuleBody, RuleHead])\n ), Rules),\n findall(X, context_check(newConc(a, [X])), N),\n\tbuildArgumentsFromRules(N, b, Rules, Rules, n).\nbuildArgumentsFromPremises :-\n findall(\n _,\n (\n parser::classic_rule(PremiseID, Premise),\n checkStrict(PremiseID, DefPrem),\n ground(Premise),\n context_assert(argument([[PremiseID], none, Premise, [], [[], [], DefPrem]])),\n context_assert(conc(Premise) :- argument([[PremiseID], none, Premise, [], [[], [], DefPrem]])),\n context_assert(newConc(a, Premise)),\n utils::hash(argument([[PremiseID], none, Premise, [], [[], [], DefPrem]]), Id),\n context_assert(arg(Id) :- argument([[PremiseID], none, Premise, [], [[], [], DefPrem]]))\n ),\n _\n ).\nbuildArgumentsFromEmptyRules :-\n findall(\n _,\n (\n emptyRule([RuleID, RulePrem, RuleHead]),\n checkStrict(RuleID, DefRule),\n ground(RuleHead),\n context_assert(argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(conc(RuleHead) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(newConc(a, RuleHead)),\n utils::hash(argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]]), Id),\n context_assert(arg(Id) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]]))\n ),\n _\n ).\nemptyRule([RuleID, Body, RuleHead]) :-\n parser::classic_rule(RuleID, Body, RuleHead),\n \\+ (member(X, Body), X \\= ~(_), X \\= prolog(_)),\n checkPrologClauses(Body).\ncheckPrologClauses([]) :- !.\ncheckPrologClauses([~(_)|T]) :- checkPrologClauses(T), !.\ncheckPrologClauses([prolog(Check)|T]) :-\n (callable(Check) -> call(Check); Check),\n checkPrologClauses(T).\nclean(Tn, Rules) :-\n invert(Tn, Tx),\n context_retract(newConc(Tx, _)),\n findall(X, context_check(newConc(Tn, [X])), N),\n buildArgumentsFromRules(N, Tx, Rules, Rules, n).\ninvert(a, b).\ninvert(b, a).\nbuildArgumentsFromRules(_, _, Rules, [], n) :- !.\nbuildArgumentsFromRules(_, Tn, Rules, [], y) :- !, clean(Tn, Rules).\nbuildArgumentsFromRules(N, Tn, Rules, [[Id, Body, Conc]|T], _) :-\n utils::contains_any(Body, N),\n findall(true, buildArgumentsFromRule(Tn, [Id, Body, Conc]), R),\n R \\== [],\n buildArgumentsFromRules(N, Tn, Rules, T, y), !.\nbuildArgumentsFromRules(N, Tn, Rules, [_|T], X) :-\n buildArgumentsFromRules(N, Tn, Rules, T, X).\nbuildArgumentsFromRule(Tn, [RuleID, RuleBody, RuleHead]) :-\n\truleBodyIsSupported(RuleID, RuleHead, RuleBody, RuleBody, [[], [], [], []], Argument),\n context_assert(newConc(Tn, RuleHead)).\ncheckStrict(Id, []) :- parser::check_strict(Id), !.\ncheckStrict(Id, [Id]).\ndefRules(Id, Def, Def) :- parser::check_strict(Id), !.\ndefRules(Id, Def, [Id|Def]).\nlastDefRules(Id, LDef, LDef) :- parser::check_strict(Id), !.\nlastDefRules(Id, LDef, [Id]) :- Id \\== none, \\+ parser::check_strict(Id).\nargumentInfo(RuleId, LDef, Def, Prem, [FLDef, FDef, FPrem]) :-\n utils::sortDistinct(Prem, FPrem),\n defRules(RuleId, Def, NDef),\n utils::sortDistinct(NDef, FDef),\n lastDefRules(RuleId, LDef, NLDef),\n utils::sortDistinct(NLDef, FLDef).\nruleBodyIsSupported(RuleID, RuleHead, RuleBody, [], [TAll, TLDef, TDef, TPrem], Argument) :-\n ground(RuleHead),\n
|
|
4589
|
+
this.f3m_1 = 'buildArgumentationGraph :-\n buildArguments,\n buildAttacks.\nbuildArguments :-\n\tbuildArgumentsFromPremises,\n\tbuildArgumentsFromEmptyRules,\n\tfindall([RuleID, RuleBody, RuleHead], (\n\t parser::classic_rule(RuleID, RuleBody, RuleHead),\n\t \\+ emptyRule([RuleID, RuleBody, RuleHead])\n ), Rules),\n findall(X, context_check(newConc(a, [X])), N),\n\tbuildArgumentsFromRules(N, b, Rules, Rules, n).\nbuildArgumentsFromPremises :-\n findall(\n _,\n (\n parser::classic_rule(PremiseID, Premise),\n checkStrict(PremiseID, DefPrem),\n ground(Premise),\n context_assert(argument([[PremiseID], none, Premise, [], [[], [], DefPrem]])),\n context_assert(conc(Premise) :- argument([[PremiseID], none, Premise, [], [[], [], DefPrem]])),\n context_assert(newConc(a, Premise)),\n utils::hash(argument([[PremiseID], none, Premise, [], [[], [], DefPrem]]), Id),\n context_assert(arg(Id) :- argument([[PremiseID], none, Premise, [], [[], [], DefPrem]]))\n ),\n _\n ).\nbuildArgumentsFromEmptyRules :-\n findall(\n _,\n (\n emptyRule([RuleID, RulePrem, RuleHead]),\n checkStrict(RuleID, DefRule),\n ground(RuleHead),\n context_assert(argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(conc(RuleHead) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(newConc(a, RuleHead)),\n utils::hash(argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]]), Id),\n context_assert(arg(Id) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]]))\n ),\n _\n ).\nemptyRule([RuleID, Body, RuleHead]) :-\n parser::classic_rule(RuleID, Body, RuleHead),\n \\+ (member(X, Body), X \\= ~(_), X \\= prolog(_)),\n checkPrologClauses(Body).\ncheckPrologClauses([]) :- !.\ncheckPrologClauses([~(_)|T]) :- checkPrologClauses(T), !.\ncheckPrologClauses([prolog(Check)|T]) :-\n (callable(Check) -> call(Check); Check),\n checkPrologClauses(T).\nclean(Tn, Rules) :-\n invert(Tn, Tx),\n context_retract(newConc(Tx, _)),\n findall(X, context_check(newConc(Tn, [X])), N),\n buildArgumentsFromRules(N, Tx, Rules, Rules, n).\ninvert(a, b).\ninvert(b, a).\nbuildArgumentsFromRules(_, _, Rules, [], n) :- !.\nbuildArgumentsFromRules(_, Tn, Rules, [], y) :- !, clean(Tn, Rules).\nbuildArgumentsFromRules(N, Tn, Rules, [[Id, Body, Conc]|T], _) :-\n utils::contains_any(Body, N),\n findall(true, buildArgumentsFromRule(Tn, [Id, Body, Conc]), R),\n R \\== [],\n buildArgumentsFromRules(N, Tn, Rules, T, y), !.\nbuildArgumentsFromRules(N, Tn, Rules, [_|T], X) :-\n buildArgumentsFromRules(N, Tn, Rules, T, X).\nbuildArgumentsFromRule(Tn, [RuleID, RuleBody, RuleHead]) :-\n\truleBodyIsSupported(RuleID, RuleHead, RuleBody, RuleBody, [[], [], [], []], Argument),\n context_assert(newConc(Tn, RuleHead)).\ncheckStrict(Id, []) :- parser::check_strict(Id), !.\ncheckStrict(Id, [Id]).\ndefRules(Id, Def, Def) :- parser::check_strict(Id), !.\ndefRules(Id, Def, [Id|Def]).\nlastDefRules(Id, LDef, LDef) :- parser::check_strict(Id), !.\nlastDefRules(Id, LDef, [Id]) :- Id \\== none, \\+ parser::check_strict(Id).\nargumentInfo(RuleId, LDef, Def, Prem, [FLDef, FDef, FPrem]) :-\n utils::sortDistinct(Prem, FPrem),\n defRules(RuleId, Def, NDef),\n utils::sortDistinct(NDef, FDef),\n lastDefRules(RuleId, LDef, NLDef),\n utils::sortDistinct(NLDef, FLDef).\nruleBodyIsSupported(RuleID, RuleHead, RuleBody, [], [TAll, TLDef, TDef, TPrem], Argument) :-\n ground(RuleHead),\n utils::appendLists(TAll, All),\n \\+ utils::contains(RuleID, All),\n utils::appendLists(TLDef, LDef),\n utils::appendLists(TDef, Def),\n utils::appendLists(TPrem, Prem),\n argumentInfo(RuleID, LDef, Def, Prem, Info),\n utils::sort([RuleID|All], Rules),\n Argument = [Rules, RuleID, RuleHead, RuleBody, Info],\n \\+ context_check(clause(conc(RuleHead), argument(Argument))),\n context_assert(conc(RuleHead) :- argument(Argument)),\n context_assert(argument(Argument)),\n utils::hash(argument(Argument), Id),\n context_assert(arg(Id) :- argument(Argument)).\nruleBodyIsSupported(RuleID, RuleHead, RuleBody, [~(_)|Others], Info, Argument) :-\n\truleBodyIsSupported(RuleID, RuleHead, RuleBody, Others, Info, Argument).\nruleBodyIsSupported(RuleID, RuleHead, RuleBody, [prolog(Check)|Others], Info, Argument) :-\n\t(callable(Check) -> call(Check); Check),\n\truleBodyIsSupported(RuleID, RuleHead, RuleBody, Others, Info, Argument).\nruleBodyIsSupported(RuleId, RuleHead, RuleBody, [Statement|Others], [All, LDef, Def, Prem], Argument) :-\n context_check(clause(conc([Statement]), argument([ArgumentID, RuleID, [Statement], Body, [NLDef, NDef, NPrem]]))),\n\truleBodyIsSupported(RuleId, RuleHead, RuleBody, Others, [[ArgumentID|All], [NLDef|LDef], [NDef|Def], [NPrem|Prem]], Argument),\n\tcontext_assert(support([ArgumentID, RuleID, [Statement], Body, [NLDef, NDef, NPrem]], Argument)).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n conflict(Conf, Head, Guard).\nfindPossibleAttackers([_, _, Head, _, _], Conf) :-\n conflict(Conf, Head).\nfindPossibleAttackers([_, _, _, Prem, _], [Conf]) :-\n member(~(Conf), Prem).\nfindPossibleAttackers([_, RuleID, _, _, _], [undercut(RuleID)]).\nbuildAttacks :-\n\tbuildDirectAttacks,\n\tbuildTransitiveAttacks.\nbuildDirectAttacks :-\n findall(_, buildDirectAttack, _).\nbuildDirectAttack :-\n context_check(argument(A)),\n findPossibleAttackers(A, BB),\n\tcontext_check(clause(conc(BB), argument(B))),\n\tA \\== B,\n attacks(T, B, A),\n\t\\+ context_check(attack(T, B, A, A)),\n\tcontext_assert(attack(T, B, A, A)),\n\tutils::hash(argument(A), IdA),\n\tutils::hash(argument(B), IdB),\n\tcontext_assert(att(IdB, IdA) :- attack(T, B, A, A)),\n\tfail.\nbuildDirectAttack.\nbuildTransitiveAttacks :-\n\tcontext_check(attack(T, A, B, D)),\n\tcontext_check(support(B, C)),\n\t\\+ context_check(attack(T, A, C, D)), !,\n\tcontext_assert(attack(T, A, C, D)),\n utils::hash(argument(A), IdA),\n utils::hash(argument(C), IdC),\n context_assert(att(IdA, IdC) :- attack(T, B, C, D)),\n buildTransitiveAttacks.\nbuildTransitiveAttacks.\nattacks(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 conflict(HeadA, HeadB).\nexpanded_conflict(HeadA, HeadB) :-\n 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], _, _]]).\ncheck(-Atom).\nconflict([Atom], [-Atom]) :- \\+ check(Atom).\nconflict([-Atom], [Atom]).\nconflict([o(Atom)], [o(-Atom)]) :- \\+ check(Atom).\nconflict([o(-Atom)], [o(Atom)]).\nconflict([p(Atom)], [o(-Atom)]) :- \\+ check(Atom).\nconflict([o(-Atom)], [p(Atom)]).\nconflict([p(-Atom)], [o(Atom)]).\nconflict([o(Atom)], [p(-Atom)]) :- \\+ check(Atom).\nconflict([sup(X, Y)], [sup(Y, X)]).';
|
|
4589
4590
|
}
|
|
4590
4591
|
var ArgumentationGraph_instance;
|
|
4591
4592
|
function ArgumentationGraph_getInstance() {
|