PublicShow sourcedyncall.pl --

This predicate assembles the clauses that are reachable from a given goal.

Issues:

Source scasp(:Query) is nondet
Source scasp(:Query, +Options) is nondet
Prove query using s(CASP) semantics. This performs the following steps:

Options are passed to scasp_compile/2. Other options processed:

model(-Model)
Unify Model with the s(CASP) model, a list of model terms. See scasp_model/1.
tree(-Tree)
Unify Tree with the s(CASP) justification tree. See scasp_justification/2 for details.
source(Boolean)
When false, do not include source origin terms into the final tree.
collect(:Goal)
Collect the program as if Goal were part of the query, without asking it. s(CASP) gathers the clauses reachable from the query and the global constraints whose call tree overlaps them, so a constraint mentioning nothing the query reaches is left out -- and an odd loop or a p/-p contradiction elsewhere in the program is left out with it. That is usually what is wanted: it is what makes scasp/2 usable on a large program. Where it is not -- where the answer must respect the whole program however unrelated it looks -- name the rest of it here:
?- scasp(q, [collect((p, r(_)))]).

Only collection is affected. The query, the model and the justification are still about Query alone.

Source scasp_show(:Query, +What)
Show some aspect of the translated s(CASP) program. Currently What is one of:
code(Options)
Show the collected program. By default shows the query and user program. To show only the integrity constraints, use:
?- scasp_show(Query, code(user(false), constraints(true))).

An option given as a bare name means true: code(constraints) is code(constraints(true)).

Source scasp_query_clauses(:Query, -Clauses) is det
Source scasp_query_clauses(:Query, -Clauses, +Options) is det
Collect the clauses relevant to Query: those reachable from it, plus the global constraints whose call tree overlaps them. collect(Goal) widens the first set without widening the query -- see scasp/2.
Arguments:
Clauses- is a list of source(ClauseRef, Clause).
Source scasp_dynamic(:Spec) is det
Declare a predicates as dynamic or thread_local. Usage patterns:

:- scasp_dynamic p/1. :- scasp_dynamic p/1 as shared.

Source scasp_assert(:Clause) is det
Source scasp_retract(:Clause) is nondet
Source scasp_retractall(:Head) is det
Wrappers for assertz/1, retract/1 and retractall/1 that deal with sCASP terms which may have a head or body terms that are wrapped in -(Term), indicating classical negation. Also deals with global constraints written in any of these formats:
Source scasp_abolish(:PredicateIndicator) is det
Remove all facts for both PredicateIndicator and its classical negation.
Source #(:Directive)
Handle s(CASP) directives. Same as :- Directive.. Provides compatibility with sCASP sources as normally found.
Source describe(:Template) is det
Same as pred/1, using the name of library(sscasp), where pred is used for declaring the domain of arguments.
Source abducible(:Spec)
Declare Spec, a comma list of heads to be abducible, meaning they can both be in or outside the model.
Source prolog(:PIs) is det
Declare PIs to be interpreted as Prolog predicates. The directive allows for the following, where Type is one of justified (default) or opaque, meaning that we call the predicate without creating a justification tree.

prolog is no longer a prefix operator. Use `:- sld PIs as Type`, which library(sscasp) understands as well.

Source sld(:PIs) is det
Same as prolog/1, using the name of library(sscasp):
:- sld PIs as Type.

prolog is not an operator, so `:- prolog p/1.` no longer reads. Use `:- sld p/1.`, which works with both libraries.

Source #=(?A, ?B)
Source #<>(?A, ?B)
Source #<(?A, ?B)
Source #>(?A, ?B)
Source #>=(?A, ?B)
Source #=<(?A, ?B)
Implementation of the s(CASP) constraints. This implementation is normally not used and mostly makes the program analysis work.

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

Source scasp_model(:Model) is semidet
Source scasp_model(:Model, +Options) is semidet
True when Model represents the current set of true and false literals.
Source scasp_justification(:Tree, +Options) is semidet
Justification for the current sCASP answer.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source abducible(Arg1, Arg2)
Source pred(Arg1)
Source show(Arg1)
Source scasp_assert(Arg1, Arg2)
Source #(Arg1, Arg2)