@tuprolog/arg2p-core 0.6.4 → 0.6.5
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/kotlin/arg2p-core.js +2 -2
- package/kotlin/arg2p-core.js.map +1 -1
- package/package.json +1 -1
- package/package.json.hash +1 -1
- package/pre-package.json +1 -1
package/kotlin/arg2p-core.js
CHANGED
|
@@ -5032,7 +5032,7 @@
|
|
|
5032
5032
|
}
|
|
5033
5033
|
function ArgumentationGraph() {
|
|
5034
5034
|
ArgumentationGraph_instance = this;
|
|
5035
|
-
this.theoryCode = trimIndent('\n buildArgumentationGraph :-\n buildArguments,\n buildAttacks.\n buildArguments :-\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 \tbuildArgumentsFromRules(b, Rules, Rules, n).\n buildArgumentsFromPremises :-\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 ).\n buildArgumentsFromEmptyRules :-\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(Premise) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(newConc(a, Premise)),\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 ).\n emptyRule([RuleID, Body, RuleHead]) :-\n parser::classic_rule(RuleID, Body, RuleHead),\n \\+ (member(X, Body), X \\= ~(_), X \\= prolog(_)),\n checkPrologClauses(Body).\n checkPrologClauses([]) :- !.\n checkPrologClauses([~(_)|T]) :- checkPrologClauses(T), !.\n checkPrologClauses([prolog(Check)|T]) :-\n (callable(Check) -> call(Check); Check),\n checkPrologClauses(T).\n clean(Tn, Rules) :-\n invert(Tn, Tx),\n context_retract(newConc(Tx, _)),\n buildArgumentsFromRules(Tx, Rules, Rules, n).\n check_new(Tn, H) :-\n copy_term(H, [_, RuleBody, _]),\n member(X, RuleBody),\n invert(Tn, Tx),\n context_check(newConc(Tx, [X])).\n invert(a, b).\n invert(b, a).\n buildArgumentsFromRules(_, Rules, [], n).\n buildArgumentsFromRules(Tn, Rules, [], y) :- clean(Tn, Rules).\n buildArgumentsFromRules(Tn, Rules, [H|T], _) :-\n once(check_new(Tn, H)),\n copy_term(H, HH),\n findall(true, buildArgumentsFromRule(Tn, HH), R),\n R \\== [],\n buildArgumentsFromRules(Tn, Rules, T, y), !.\n buildArgumentsFromRules(Tn, Rules, [_|T], X) :-\n buildArgumentsFromRules(Tn, Rules, T, X).\n buildArgumentsFromRule(Tn, [RuleID, RuleBody, RuleHead]) :-\n \truleBodyIsSupported(RuleBody, [], [], SupportRules, ArgSupports),\n \t\\+ member(RuleID, SupportRules),\n \tground(RuleHead),\n \tutils::sort([RuleID|SupportRules], SortedPremises),\n \t\\+ context_check(argument([SortedPremises, RuleID, RuleHead, RuleBody, _])),\n \tbuildArgumentInfo(ArgSupports, RuleID, Info),\n NewArgument = [SortedPremises, RuleID, RuleHead, RuleBody, Info],\n context_assert(conc(RuleHead) :- argument(NewArgument)),\n context_assert(newConc(Tn, RuleHead)),\n \tcontext_assert(argument(NewArgument)),\n \tutils::hash(argument(NewArgument), Id),\n \tcontext_assert(arg(Id) :- argument(NewArgument)),\n \tsupports(NewArgument, ArgSupports).\n supports(Argument, Supports) :-\n findall(_, (\n member(S, Supports),\n context_assert(support(S, Argument))\n ), _).\n checkStrict(Id, [Id]) :- \\+ parser::check_strict(Id).\n checkStrict(Id, []) :- parser::check_strict(Id).\n buildArgumentInfo(Supports, RuleId, [LastDefRules, DefRules, DefPrem]) :-\n defeasibleRules(RuleId, Supports, DefRules),\n ordinaryPremises(Supports, DefPrem),\n lastDefeasibleRules(Supports, RuleId, LastDefRules).\n ordinaryPremises(Supports, DefPrem) :-\n findall(Def, member([_, _, _, _, [_, _, Def]], Supports), Prem),\n utils::appendLists(Prem, TempPrem),\n utils::sortDistinct(TempPrem, DefPrem).\n defeasibleRules(RuleId, Supports, DefRules) :-\n \tfindall(Def, member([_, _, _, _, [_, Def, _]], Supports), UnsortedRules),\n \tcheckStrict(RuleId, DefRule),\n \tutils::appendLists([DefRule|UnsortedRules], TempRules),\n \tutils::sortDistinct(TempRules, DefRules).\n lastDefeasibleRules(_, TopRule, [TopRule]) :-\n TopRule \\== none, \\+ parser::check_strict(TopRule).\n lastDefeasibleRules(Supports, TopRule, LastRules) :-\n \tparser::check_strict(TopRule),\n \tfindall(Def, member([_, _, _, _, [Def, _, _]], Supports), Res),\n \tutils::appendLists(Res, TempLastRules),\n \tutils::sortDistinct(TempLastRules, LastRules).\n ruleBodyIsSupported([], ResultPremises, ResultSupports, ResultPremises, ResultSupports).\n ruleBodyIsSupported([~(_)|Others], Premises, Supports, ResultPremises, ResultSupports) :-\n \truleBodyIsSupported(Others, Premises, Supports, ResultPremises, ResultSupports)
|
|
5035
|
+
this.theoryCode = trimIndent('\n buildArgumentationGraph :-\n buildArguments,\n buildAttacks.\n buildArguments :-\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 \tbuildArgumentsFromRules(b, Rules, Rules, n).\n buildArgumentsFromPremises :-\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 ).\n buildArgumentsFromEmptyRules :-\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(Premise) :- argument([[RuleID], RuleID, RuleHead, RulePrem, [DefRule, DefRule, []]])),\n context_assert(newConc(a, Premise)),\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 ).\n emptyRule([RuleID, Body, RuleHead]) :-\n parser::classic_rule(RuleID, Body, RuleHead),\n \\+ (member(X, Body), X \\= ~(_), X \\= prolog(_)),\n checkPrologClauses(Body).\n checkPrologClauses([]) :- !.\n checkPrologClauses([~(_)|T]) :- checkPrologClauses(T), !.\n checkPrologClauses([prolog(Check)|T]) :-\n (callable(Check) -> call(Check); Check),\n checkPrologClauses(T).\n clean(Tn, Rules) :-\n invert(Tn, Tx),\n context_retract(newConc(Tx, _)),\n buildArgumentsFromRules(Tx, Rules, Rules, n).\n check_new(Tn, H) :-\n copy_term(H, [_, RuleBody, _]),\n member(prolog(_), RuleBody), !.\n check_new(Tn, H) :-\n copy_term(H, [_, RuleBody, _]),\n member(X, RuleBody),\n invert(Tn, Tx),\n context_check(newConc(Tx, [X])).\n invert(a, b).\n invert(b, a).\n buildArgumentsFromRules(_, Rules, [], n).\n buildArgumentsFromRules(Tn, Rules, [], y) :- clean(Tn, Rules).\n buildArgumentsFromRules(Tn, Rules, [H|T], _) :-\n once(check_new(Tn, H)),\n copy_term(H, HH),\n findall(true, buildArgumentsFromRule(Tn, HH), R),\n R \\== [],\n buildArgumentsFromRules(Tn, Rules, T, y), !.\n buildArgumentsFromRules(Tn, Rules, [_|T], X) :-\n buildArgumentsFromRules(Tn, Rules, T, X).\n buildArgumentsFromRule(Tn, [RuleID, RuleBody, RuleHead]) :-\n \truleBodyIsSupported(RuleBody, [], [], SupportRules, ArgSupports),\n \t\\+ member(RuleID, SupportRules),\n \tground(RuleHead),\n \tutils::sort([RuleID|SupportRules], SortedPremises),\n \t\\+ context_check(argument([SortedPremises, RuleID, RuleHead, RuleBody, _])),\n \tbuildArgumentInfo(ArgSupports, RuleID, Info),\n NewArgument = [SortedPremises, RuleID, RuleHead, RuleBody, Info],\n context_assert(conc(RuleHead) :- argument(NewArgument)),\n context_assert(newConc(Tn, RuleHead)),\n \tcontext_assert(argument(NewArgument)),\n \tutils::hash(argument(NewArgument), Id),\n \tcontext_assert(arg(Id) :- argument(NewArgument)),\n \tsupports(NewArgument, ArgSupports).\n supports(Argument, Supports) :-\n findall(_, (\n member(S, Supports),\n context_assert(support(S, Argument))\n ), _).\n checkStrict(Id, [Id]) :- \\+ parser::check_strict(Id).\n checkStrict(Id, []) :- parser::check_strict(Id).\n buildArgumentInfo(Supports, RuleId, [LastDefRules, DefRules, DefPrem]) :-\n defeasibleRules(RuleId, Supports, DefRules),\n ordinaryPremises(Supports, DefPrem),\n lastDefeasibleRules(Supports, RuleId, LastDefRules).\n ordinaryPremises(Supports, DefPrem) :-\n findall(Def, member([_, _, _, _, [_, _, Def]], Supports), Prem),\n utils::appendLists(Prem, TempPrem),\n utils::sortDistinct(TempPrem, DefPrem).\n defeasibleRules(RuleId, Supports, DefRules) :-\n \tfindall(Def, member([_, _, _, _, [_, Def, _]], Supports), UnsortedRules),\n \tcheckStrict(RuleId, DefRule),\n \tutils::appendLists([DefRule|UnsortedRules], TempRules),\n \tutils::sortDistinct(TempRules, DefRules).\n lastDefeasibleRules(_, TopRule, [TopRule]) :-\n TopRule \\== none, \\+ parser::check_strict(TopRule).\n lastDefeasibleRules(Supports, TopRule, LastRules) :-\n \tparser::check_strict(TopRule),\n \tfindall(Def, member([_, _, _, _, [Def, _, _]], Supports), Res),\n \tutils::appendLists(Res, TempLastRules),\n \tutils::sortDistinct(TempLastRules, LastRules).\n ruleBodyIsSupported([], ResultPremises, ResultSupports, ResultPremises, ResultSupports).\n ruleBodyIsSupported([~(_)|Others], Premises, Supports, ResultPremises, ResultSupports) :-\n \truleBodyIsSupported(Others, Premises, Supports, ResultPremises, ResultSupports), !.\n ruleBodyIsSupported([prolog(Check)|Others], Premises, Supports, ResultPremises, ResultSupports) :-\n \t(callable(Check) -> call(Check); Check),\n \truleBodyIsSupported(Others, Premises, Supports, ResultPremises, ResultSupports), !.\n ruleBodyIsSupported([Statement|Others], Premises, Supports, ResultPremises, ResultSupports) :-\n context_check(clause(conc([Statement]), argument([ArgumentID, RuleID, [Statement], Body, Info]))),\n \tappend(ArgumentID, Premises, NewPremises),\n \truleBodyIsSupported(Others, NewPremises, [[ArgumentID, RuleID, [Statement], Body, Info]|Supports], ResultPremises, ResultSupports).\n findPossibleAttackers([_, _, Head, _, _], Conf) :-\n conflict(Conf, Head, Guard).\n findPossibleAttackers([_, _, Head, _, _], Conf) :-\n conflict(Conf, Head).\n findPossibleAttackers([_, _, _, Prem, _], [Conf]) :-\n member(~(Conf), Prem).\n findPossibleAttackers([_, RuleID, _, _, _], [undercut(RuleID)]).\n buildAttacks :-\n \tbuildDirectAttacks,\n \tbuildTransitiveAttacks.\n buildDirectAttacks :-\n findall(_, buildDirectAttack, _).\n buildDirectAttack :-\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.\n buildDirectAttack.\n buildTransitiveAttacks :-\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.\n buildTransitiveAttacks.\n attacks(rebut, A, B) :- rebuts(A, B), !.\n attacks(contrary_rebut, A, B) :- contraryRebuts(A, B), !.\n attacks(undermine, A, B) :- undermines(A, B), !.\n attacks(contrary_undermine, A, B) :- contraryUndermines(A, B), !.\n attacks(undercut, A, B) :- undercuts(A, B), !.\n expanded_conflict(HeadA, HeadB) :-\n conflict(HeadA, HeadB).\n expanded_conflict(HeadA, HeadB) :-\n conflict(HeadA, HeadB, Guard),\n (callable(Guard) -> call(Guard); Guard).\n rebuts([IDPremisesA, RuleA, RuleHeadA, _, _], [IDPremisesB, RuleB, RuleHeadB, _, Info]) :-\n \tRuleB \\== none,\n Info \\== [[], [], []],\n \texpanded_conflict(RuleHeadA, RuleHeadB).\n contraryRebuts([IDPremisesA, RuleA, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n \tRuleA \\== none,\n \tRuleB \\== none,\n \tmember(~(RuleHeadA), Body).\n undermines([IDPremisesA, RuleA, RuleHeadA, _, _], [[IDPremiseB], none, RuleHeadB, _, Info]) :-\n \tInfo \\== [[], [], []],\n \texpanded_conflict(RuleHeadA, RuleHeadB).\n contraryUndermines([IDPremisesA, none, [RuleHeadA], _, _], [IDPremisesB, RuleB, RuleHeadB, Body, Info]) :-\n \tRuleB \\== none,\n \tmember(~(RuleHeadA), Body).\n undercuts([_, _, [undercut(RuleB)], _, _], [_, RuleB, _, _, [[RuleB], _, _]]).\n check(-Atom).\n conflict([Atom], [-Atom]) :- \\+ check(Atom).\n conflict([-Atom], [Atom]).\n conflict([o(Atom)], [o(-Atom)]) :- \\+ check(Atom).\n conflict([o(-Atom)], [o(Atom)]).\n conflict([p(Atom)], [o(-Atom)]) :- \\+ check(Atom).\n conflict([o(-Atom)], [p(Atom)]).\n conflict([p(-Atom)], [o(Atom)]).\n conflict([o(Atom)], [p(-Atom)]) :- \\+ check(Atom).\n conflict([sup(X, Y)], [sup(Y, X)]).\n ');
|
|
5036
5036
|
}
|
|
5037
5037
|
ArgumentationGraph.$metadata$ = {
|
|
5038
5038
|
kind: Kind_OBJECT,
|
|
@@ -5870,8 +5870,8 @@
|
|
|
5870
5870
|
PrologWithArgumentationImpl.prototype.anyUnifyWith = PrologWithArgumentation.prototype.anyUnifyWith;
|
|
5871
5871
|
PrologWithArgumentationImpl.prototype.list = PrologWithArgumentation.prototype.list;
|
|
5872
5872
|
PrologWithArgumentationImpl.prototype.listFrom = PrologWithArgumentation.prototype.listFrom;
|
|
5873
|
-
PrologWithArgumentationImpl.prototype.listFromSequence = PrologWithArgumentation.prototype.listFromSequence;
|
|
5874
5873
|
PrologWithArgumentationImpl.prototype.listFromIterable = PrologWithArgumentation.prototype.listFromIterable;
|
|
5874
|
+
PrologWithArgumentationImpl.prototype.listFromSequence = PrologWithArgumentation.prototype.listFromSequence;
|
|
5875
5875
|
PrologWithArgumentationImpl.prototype.matchAny = PrologWithArgumentation.prototype.matchAny;
|
|
5876
5876
|
PrologWithArgumentationImpl.prototype.mguWithOccurCheck = PrologWithArgumentation.prototype.mguWithOccurCheck;
|
|
5877
5877
|
PrologWithArgumentationImpl.prototype.mguAny = PrologWithArgumentation.prototype.mguAny;
|