utils
Entry points · Kotlin object UtilsModule · library prolog.argumentation.utils
Utilities on lists and on the labels of the context (module utils), most of them native primitives.
- Called by: debug, parser, transposition, abstractGraph, argumentBuilder, attackRelation, graphStore, superiority, bp, defeasibleAllPref, abaPref, abstract, structuredPartial, queryExploration, semistable, ideal, eager, stage, cf2, scc, bp_grounded, bp_grounded_partial, bp_grounded_complete
| Predicate | Description |
|---|---|
writeList/1 | The items of List written one after the other, then a new line |
writeListNl/1 | The items of List written each on a line |
appendFast/3 | List is List1 followed by List2, in one step |
appendLists/2 | Result is the concatenation of the lists in Lists |
assertAll/1 | Each of Clauses asserted in the context |
forEach/3 | Goal (all its solutions) for each element of List, as findall(_, (member(Element, List), Goal), _), but without List in the goals of the iterations: with variable tracking, every resolution step visits the terms of the goal it belongs to, so the list would make every step as costly as it is long |
contains/2 | An element of List matches Element (without binding it) |
containsAny/2 | An element of List matches one of Elements (without binding them) |
sort/2 | Reverse standard order of terms, duplicates kept (as the former quicksort) |
deduplicate/2 | Standard order of terms, duplicates removed (as setof/3) |
sortDistinct/2 | Reverse standard order of terms, duplicates removed (deduplicate/2, then sort/2) |
minimalBySet/2 | The values of the Set-Value pairs whose Set has no strict subset among the others (elements compared as ground terms), in order: minimal_set/2 over a whole collection in one step |
uniqueByFirst/2 | Lists keeping, among the lists with the same first element, only the last one (in their order) |
intersection/2 | The elements of the first list in Sets that are in all of them, in its order (elements compared as ground terms); fails if Sets is empty |
subtract/3 | The elements of List not in Removed, in order (elements compared as ground terms), without the recursion of a Prolog subtract (whose frames would all keep the rest of the list) |
sccs/1 | Strongly connected components of the attack graph, as lists of argument identifiers, in topological order (a component is only attacked by itself and by the components before it) |
sccs/2 | Strongly connected components of the subgraph of the arguments in Ids, as lists of argument identifiers, in topological order |
writeList/1
writeList(+List)The items of List written one after the other, then a new line.
writeListNl/1
writeListNl(+List)The items of List written each on a line.
appendFast/3
appendFast(+List1, +List2, -List)Native primitive.
List is List1 followed by List2, in one step
appendLists/2
appendLists(Lists, Result)Native primitive.
Result is the concatenation of the lists in Lists
assertAll/1
assertAll(+Clauses)Native primitive.
Each of Clauses asserted in the context
forEach/3
forEach(?Element, +List, +Goal)Native primitive.
Goal (all its solutions) for each element of List, as findall(_, (member(Element, List), Goal), _), but without List in the goals of the iterations: with variable tracking, every resolution step visits the terms of the goal it belongs to, so the list would make every step as costly as it is long. Goal runs in this module: other modules are called through ::.
contains/2
contains(?Element, +List)Native primitive.
An element of List matches Element (without binding it)
containsAny/2
containsAny(+Elements, +List)Native primitive.
An element of List matches one of Elements (without binding them)
sort/2
sort(+List, ?Sorted)Native primitive.
Reverse standard order of terms, duplicates kept (as the former quicksort)
deduplicate/2
deduplicate(+List, ?Deduplicated)Native primitive.
Standard order of terms, duplicates removed (as setof/3)
sortDistinct/2
sortDistinct(+List, ?Sorted)Native primitive.
Reverse standard order of terms, duplicates removed (deduplicate/2, then sort/2)
minimalBySet/2
minimalBySet(+Pairs, -Values)Native primitive.
The values of the Set-Value pairs whose Set has no strict subset among the others (elements compared as ground terms), in order: minimal_set/2 over a whole collection in one step
uniqueByFirst/2
uniqueByFirst(+Lists, ?Unique)Native primitive.
Lists keeping, among the lists with the same first element, only the last one (in their order)
intersection/2
intersection(+Sets, -Intersection)Native primitive.
The elements of the first list in Sets that are in all of them, in its order (elements compared as ground terms); fails if Sets is empty
subtract/3
subtract(+List, +Removed, ?Rest)Native primitive.
The elements of List not in Removed, in order (elements compared as ground terms), without the recursion of a Prolog subtract (whose frames would all keep the rest of the list)
sccs/1
sccs(-Sccs)Native primitive.
Strongly connected components of the attack graph, as lists of argument identifiers, in topological order (a component is only attacked by itself and by the components before it).
sccs/2
sccs(+Ids, -Sccs)Native primitive.
Strongly connected components of the subgraph of the arguments in Ids, as lists of argument identifiers, in topological order.