/swish/pack/sCASP/prolog/scasp/dyncall.pl
All Application Manual Name SummaryHelp

  • prolog
    • scasp
      • embed.pl -- Embed sCASP programs in Prolog sources
      • ops.pl
      • input.pl -- Read SASP source code
      • common.pl -- Common predicates used in multiple files
      • program.pl -- Input program access
      • variables.pl -- Variable storage and access
      • source_ref.pl -- s(CASP) source references
      • compile.pl -- s(ASP) Ungrounded Stable Models Solver
      • predicates.pl -- Basic information about sCASP predicates
      • comp_duals.pl -- Dual rule computation
      • options.pl -- (Command line) option handling for sCASP
      • nmr_check.pl -- Detect OLON rules and construct nmr_check
      • call_graph.pl -- Build the call graph used for NMR check construction and indexing.
      • pr_rules.pl -- Output formatting and printing.
      • modules.pl -- Encode modules
      • solve.pl -- The sCASP solver
      • verbose.pl -- Print goal and stack in Ciao compatible format
      • prolog.pl
      • model.pl -- sCASP model handling
      • output.pl -- Emit sCASP terms
      • stack.pl
      • listing.pl
      • human.pl -- Print s(CASP) output in human language
      • html.pl -- Render s(CASP) justification as HTML
      • html_text.pl -- Switch between HTML and plain text output
      • messages.pl
      • dyncall.pl --
        • scasp/1
        • scasp/2
        • scasp_show/2
        • scasp_query_clauses/2
        • scasp_query_clauses/3
        • scasp_dynamic/1
        • scasp_assert/1
        • scasp_retract/1
        • scasp_retractall/1
        • scasp_abolish/1
        • #/1
        • describe/1
        • abducible/1
        • prolog/1
        • sld/1
        • #=/2
        • #<>/2
        • #</2
        • #>/2
        • #>=/2
        • #=</2
      • coverage.pl
      • swish.pl -- s(CASP) adapter for SWISH
 scasp(:Query) is nondet
 scasp(:Query, +Options) is nondet
Prove query using s(CASP) semantics. This performs the following steps:
  • Collect (transitively) all clauses that are reachable from Query.
  • Collect all global constraints whose call-tree overlaps with the query call tree.
  • Establish the compiled s(CASP) representation in a temporary module
  • Run the s(CASP) solver
  • Optionally extract the model and justification tree.

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.