SWI-Prolog port (swipl branch)

This is a fork from https://gitlab.software.imdea.org/ciao-lang/sCASP. It provides a port of s(CASP) to SWI-Prolog.

About the SWI-Prolog port

The SWI-Prolog port is fully functional and from the solver prespective fully compatible with the Ciao original. The SWI-Prolog port provides two significant optimizations: (1) a more low level implementation for the term copying required for forall constructs that result from dual rules for clauses that introduce variables in the body as well as for global constraint and (2) an index to speedup finding loops and already proved literals. This often leads to about 10 times better performance.

Running requires SWI-Prolog 8.5.6 or later. The scasp executable can be build on POSIX systems by running make in the toplevel of the sCASP directory. On Windows

The command line arguments are similar, but with small differences due to the use of SWI-Prolog's commandline parser. Run scasp -h for details. The output is different, using Unicode and, if possible, color to simplify reading the model and justification.

Next to using the s(CASP) executable, s(CASP) can be used as a library. For this, activate the sCASP directory as a SWI-Prolog add on by starting SWI-Prolog in the top directory and run

?- pack_install(.).

Now you can load scasp using

:- use_module(library(scasp)).

Running s(CASP) queries take a normal Prolog program that can be made available in the usual way: by consulting a file, asserting, etc. The program must respect the sCASP restrictions. Using any built-in or control structure that is not known to s(CASP) results in an error.

From the toplevel REPL loop, s(CASP) queries are executed by prefixing them with one of the 7 operators below.

OpDescription
?--Prove and only show the bindings
?+-Prove, show bindings and model
?-+Prove, show bindings and justification (tree)
?++Prove, show bindings model and justification)
??+-As above, but using human language output
??-+
??++

? and ?? are backward compatible aliases for ?+- and ?++. For example, this shows the model.

?- ? p(X).

The predicate scasp/2 can be used to get access to the model and tree to reason about them. For example, this returns the model as a list of terms and the justification as a tree structure.

?- scasp(goal(X), [model(M), tree(T)]).

SWI-Prolog s(CASP) can also be used in your browser using SWISH.

Finally, there is a simple web server. This server can also be deployed locally using the command below. Add -h for options.

swipl examples/dyncall/http.pl

The web server lets you post s(CASP) programs and get their results as HTML or JSON. See Help for details.

About s(CASP)

The s(CASP) system is a top-down interpreter for ASP programs with constraints.

This work was presented at ICLP'18 (Arias et al. 2018), also available here.

And extended description of the justification trees was presented at ICLP'20 (Arias et al. 2020).

Introduction

s(CASP) by Joaquin Arias, is based on s(ASP) by Kyle Marple.

s(CASP) is an implementation of the stable model semantics of constraint logic programming. Unlike similar systems, it does not employ any form of grounding. This allows s(CASP) to execute programs that are not finitely groundable, including those which make use of lists and terms.

Usage of s(CASP)

Usage:

scasp [options] InputFile(s)

Using the principal options

Let us consider the program test.pl:

p(A) :- not q(A).
q(A) :- not p(A).
?- p(A).

Explanation and debugging

Examples & Benchmarks & Event Calculus

Examples

There are some examples, most of them available in the distribution of s(ASP). Check them [here](examples/) and in your local installation (the default folder is `~/.ciao/sCASP`).

Towers of Hanoi

s(CASP) vs Clingo standard vs Clingo incremental.

See more details here.

Stream data reasoning

Let us assume that we deal with series of data items, some of which may be contradictory. Moreover, different sources may give data a different degree of trustworthiness which can make some pieces of inconsistent data to be preferred. Lets us assume that p(A) and q(A) are contradictory and we receive, from source S1, p(A) and, from source S2, q(a). We may decide that: (i) p(A) is true because S1 is more realiable; (ii) or if S2 is more realiable, q(a) is true, and any value `not a` (i.e., X \= a) p(A) is also true; (iii) or, if both sources are equally reliable, them we have (at least) two different models: one where q(a) is true and another where p(A) is true (also for X=a).

See more details here.

Traveling salesman

A variant of the traveling salesman problem (visiting every city in a country only once, starting and ending in the same city, and moving between cities using the existing connections) where, in addition, we want to find out the length of the Hamiltonian cycle.

Solutions for this problem using `CLP(FD) and ASP` appear in (Dovier et al. 2005), with comparable performance. However, they show that the ASP encoding is more compact, even if the `CLP(FD)` version uses the library predicate circuit/1, which does the bulk of the work and whose code is non-trivial.

We will show that also in this problem, where the ASP solution is more compact than that of `CLP(FD)`, s(CASP) is more expressive.

See more details here

Yale shooting scenario

Let us compare the expressiveness of s(CASP) vs ASP + constraints using the spoiling Yale shooting scenario (Janhunen et al. 2017).

In this scenario we have an unloaded gun and three possible actions load, shoot, and wait. If we load the gun, it becomes loaded. If we shoot the gun and it was loaded for no more than 35 minutes, the turkey is killed. Otherwise, the gun powder is spoiled. We are looking for an executable plan such that:

Event Calculus

Let us use s(CASP) to implement Event Calculus, a more complex application, with several scenarios.

In this [folder](examples/benchmark_EventCalculus/lopstr19/) you will find the benchmark and instruction to reproduce the evaluation and example presented in the paper "Modelling and Reasoning in Event Calculus using Goal-Directed Constraint Answer Set Programming", presented in LOPSTR'19.

See more details here

Prolog files

ATTIC/misc_programs/count_asp.plShow source
ATTIC/misc_programs/hanoi_for_simple_minds.plShow source
ATTIC/misc_programs/hanoi_for_simple_minds_2.plShow source
ATTIC/misc_programs/hanoi_for_simple_minds_3.plShow source
ATTIC/misc_programs/new_hanoi_2.plShow source
ATTIC/misc_programs/new_hanoi_3.plShow source
ATTIC/scripts/diseq_oracle.plShow source
ATTIC/scripts/refactor.plShow source
ATTIC/test_findall/call.plShow source
ATTIC/test_findall/findall01.plShow source
ATTIC/test_forall/diseq01-ok.plShow source
ATTIC/test_forall/diseq02-ok.plShow source
ATTIC/test_forall/test01-ok.plShow source
ATTIC/test_forall/test02-fail.plShow source
ATTIC/test_forall/test03-fail.plShow source
ATTIC/test_forall/test05-ok.plShow source
ATTIC/test_justification/fever3.plShow source
ATTIC/test_justification/fever4.plShow source
ATTIC/test_justification/output-fever3.plShow source
ATTIC/test_justification/output-fever4.plShow source
ATTIC/test_sasp/abdbirds.plShow source
ATTIC/test_sasp/birds.plShow source
ATTIC/test_sasp/birds2.plShow source
ATTIC/test_sasp/classic_negation.plShow source
ATTIC/test_sasp/classical_neg_entail.plShow source
ATTIC/test_sasp/cofailure.plShow source
ATTIC/test_sasp/directive_test.plShow source
ATTIC/test_sasp/errtest.plShow source
ATTIC/test_sasp/family.plShow source
ATTIC/test_sasp/gpa.plShow source
ATTIC/test_sasp/graph.plShow source
ATTIC/test_sasp/hamcycle.plShow source
ATTIC/test_sasp/hamcycle2.plShow source
ATTIC/test_sasp/hamcycle_two.plShow source
ATTIC/test_sasp/hanoi.plShow source
ATTIC/test_sasp/hanoi_7.plShow source
ATTIC/test_sasp/hanoi_clp.plShow source
ATTIC/test_sasp/left-rec-succ_BAD.plShow source
ATTIC/test_sasp/left.plShow source
ATTIC/test_sasp/lion.plShow source
ATTIC/test_sasp/list.plShow source
ATTIC/test_sasp/loop_pos.plShow source
ATTIC/test_sasp/loop_succ_pos.plShow source
ATTIC/test_sasp/loopvar.plShow source
ATTIC/test_sasp/loopvar2.plShow source
ATTIC/test_sasp/member.plShow source
ATTIC/test_sasp/multitest.plShow source
ATTIC/test_sasp/natnum.plShow source
ATTIC/test_sasp/oddloop_odd.plShow source
ATTIC/test_sasp/paperexample.plShow source
ATTIC/test_sasp/path.plShow source
ATTIC/test_sasp/path_loop.plShow source
ATTIC/test_sasp/pos_loop2_simple.plShow source
ATTIC/test_sasp/pos_loop_pass_simple.plShow source
ATTIC/test_sasp/pos_loop_simple.plShow source
ATTIC/test_sasp/pq_asp.plShow source
ATTIC/test_sasp/pq_loop.plShow source
ATTIC/test_sasp/pq_loop_b.plShow source
ATTIC/test_sasp/queens.plShow source
ATTIC/test_sasp/queens_hide.plShow source
ATTIC/test_sasp/queens_hide_d0.plShow source
ATTIC/test_sasp/queens_old.plShow source
ATTIC/test_sasp/reflexive.plShow source
ATTIC/test_sasp/schedule.plShow source
ATTIC/test_sasp/simple.plShow source
ATTIC/test_sasp/struct.plShow source
ATTIC/test_sasp/succ.plShow source
ATTIC/test_sasp/test1.plShow source
ATTIC/test_sasp/test10.plShow source
ATTIC/test_sasp/test11.plShow source
ATTIC/test_sasp/test12.plShow source
ATTIC/test_sasp/test13.plShow source
ATTIC/test_sasp/test14.plShow source
ATTIC/test_sasp/test15.plShow source
ATTIC/test_sasp/test16.plShow source
ATTIC/test_sasp/test17.plShow source
ATTIC/test_sasp/test18.plShow source
ATTIC/test_sasp/test19.plShow source
ATTIC/test_sasp/test2.plShow source
ATTIC/test_sasp/test20.plShow source
ATTIC/test_sasp/test21.plShow source
ATTIC/test_sasp/test3.plShow source
ATTIC/test_sasp/test4.plShow source
ATTIC/test_sasp/test5.plShow source
ATTIC/test_sasp/test6.plShow source
ATTIC/test_sasp/test7.plShow source
ATTIC/test_sasp/test8.plShow source
ATTIC/test_sasp/test9.plShow source
ATTIC/test_sasp/varcon.plShow source
ATTIC/test_sasp/vars_optional.plShow source
ATTIC/test_scasp/ball_asp.plShow source
ATTIC/test_scasp/ball_tclpq.plShow source
ATTIC/test_scasp/block_asp.plShow source
ATTIC/test_scasp/clingcon_example.plShow source
ATTIC/test_scasp/cross_train_Pontelli_97.plShow source
ATTIC/test_scasp/ezsmt_light.plShow source
ATTIC/test_scasp/s.plShow source
ATTIC/test_scasp/weight_seq/select_instance.plShow source
ATTIC/test_scasp/weight_seq/weight_seq_clp.plShow source
ATTIC/test_scasp/weight_seq/weight_seq_ezsmt.plShow source
ATTIC/test_scasp/weight_seq/weight_seq_scasp.plShow source
ATTIC/test_scasp/weight_seq/weight_seq_tclp.plShow source
ATTIC/test_scasp/zhou_birds.plShow source
ATTIC/test_tabling/edge.plShow source
ATTIC/test_tabling/notp.plShow source
ATTIC/test_tabling/notpq.plShow source
ATTIC/test_tabling/p.plShow source
ATTIC/test_tabling/path.plShow source
ATTIC/test_tabling/pq.plShow source
ATTIC/test_tabling/prop.plShow source
Manifest/Manifest.plShow source
doc/SETTINGS.plShow source
doc/scasp_man.plShow source
doc/user_installation.plShow source
doc/user_usage.plShow source
examples/benchmark_EventCalculus/lopstr19/aux-sasp/bec_light_sasp_discrete_0.25.plShow source
examples/benchmark_EventCalculus/lopstr19/aux-sasp/bec_light_sasp_discrete_0.5.plShow source
examples/benchmark_EventCalculus/lopstr19/aux-sasp/bec_theory_discrete.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/bec_theory.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-light/bec_light_01.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-light/bec_light_02.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-light/bec_light_03_inconsistent.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-light/bec_light_04_theinconsistencedonothappens.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-tap/bec_tap_01_overflow.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-tap/bec_tap_02_no_overflow.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-tap/bec_tap_03_two_models.plShow source
examples/benchmark_EventCalculus/lopstr19/event-calculus/example-tap/bec_tap_04_abducible_infer_event_time.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/bec_theory.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/light/bec_light_01.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/light/bec_query01.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/light/bec_query02.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/light/bec_query03.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/light/bec_query0x.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/vessel/bec_queries.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/vessel/bec_query01.plShow source
examples/benchmark_EventCalculus/lopstr19/sCASP-clingo/vessel/bec_vessel_01.plShow source
examples/benchmark_iclp18/sasp_vs_scasp/hamcycle_one.plShow source
examples/benchmark_iclp18/sasp_vs_scasp/hamcycle_two.plShow source
examples/benchmark_iclp18/sasp_vs_scasp/hanoi_8.plShow source
examples/benchmark_iclp18/sasp_vs_scasp/queens_4.plShow source
examples/benchmark_iclp18/stream_data_reasoning/new_stream.plShow source
examples/benchmark_iclp18/stream_data_reasoning/stream_reasoning.plShow source
examples/benchmark_iclp18/towers_hanoi/hanoi_min.plShow source
examples/benchmark_iclp18/towers_hanoi/hanoi_scasp_7.plShow source
examples/benchmark_iclp18/towers_hanoi/hanoi_scasp_8.plShow source
examples/benchmark_iclp18/towers_hanoi/hanoi_scasp_9.plShow source
examples/benchmark_iclp18/towers_hanoi/new_hanoi.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_incremental_7.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_incremental_8.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_incremental_9.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_standard_5.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_standard_6.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_standard_7.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_standard_8.plShow source
examples/benchmark_iclp18/towers_hanoi/toh_standard_9.plShow source
examples/benchmark_iclp18/traveling_salesman/hamiltonian_asp.plShow source
examples/benchmark_iclp18/traveling_salesman/hamiltonian_scasp.plShow source
examples/benchmark_iclp18/yale_shooting_scenario/yale_shooting_casp.plShow source
examples/benchmark_iclp18/yale_shooting_scenario/yale_shooting_casp_v2.plShow source
examples/benchmark_iclp18/yale_shooting_scenario/yale_shooting_clingoLD.plShow source
examples/birds.plShow source
examples/classic_negation_incostistent.plShow source
examples/compiled/birds_compiled.plShow source
examples/compiled/birds_compiled_raw.plShow source
examples/dyncall/birds.plShow source
examples/dyncall/http.plShow source
examples/dyncall/pas/PAS_case.plShow source
examples/dyncall/pas/PAS_guide.plShow source
examples/dyncall/pas/PAS_patient.plShow source
examples/dyncall/pas/PAS_rules.plShow source
examples/dyncall/pas/PAS_server.plShow source
examples/dyncall/solve_findall.plShow source
examples/embed/birds.plShow source
examples/embed/pas.plShow source
examples/embed/pq.plShow source
examples/entail_loop.plShow source
examples/family.plShow source
examples/hamcycle.plShow source
examples/hamcycle_two.plShow source
examples/hanoi.plShow source
examples/hanoi_7.plShow source
examples/min_model.plShow source
examples/pq.plShow source
examples/queens.plShow source
examples/rps.plShow source
pack.plShow source
prolog/scasp.pl  -- Using s(CASP) from PrologShow source
?++/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
?+++/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
?+-/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
?-+/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
?--/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
??++/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
??+-/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
??-+/1Shortcuts for scasp/1 that control printing the model and/or tree and the format.Source
prolog/scasp/call_graph.pl  -- Build the call graph used for NMR check construction and indexing.Show source
prolog/scasp/clp/call_stack.pl  -- Call stack constraint solverShow source
prolog/scasp/clp/clpq.pl  -- Extension of the constraint solver CLP(Q)Show source
prolog/scasp/clp/disequality.pl  -- Constraint solver for disequalitiesShow source
.=./2Constructive unification of a negatively constrained variable with a non- variable value will succeed if the non-variable value does not constructively unify with any element in the variable’s prohibited value list.Source
.\=./2Source
loop_term/2Source
not_unify/2True when Term cannot unify with any of the elements in List.Source
∉/2Constraint that expresses that X is not a member of the list of ground elements in G.Source
prolog/scasp/common.pl  -- Common predicates used in multiple filesShow source
c_rule/3Convert a rule structure into its head and body, or vice-versa.Source
create_unique_functor/3Create a unique functor by inserting the counter characters just before the _Arity.Source
intern_negation/2Source
is_dual/1Succeed if a functor contains the prefix '_not_', indicating that it's a dual.Source
is_global_constraint/2True when this is a predicate implementing the Nth global constraint.Source
join_functor/3Source
negate_functor/2Given the functor of a predicate (of the form name/arity), return the negation.Source
operator/3ASP/Prolog operator table.Source
predicate/3Convert a predicate struct to its components, or vice-versa.Source
raise_negation/2Source
rule/4Convert a rule structure with an id into its head, ID and body, or vice-versa.Source
prolog/scasp/comp_duals.pl  -- Dual rule computationShow source
comp_duals/0Compute rules for the negations of positive literals (dual rules), even if there are no clauses for the positive literal (negation will be a fact).Source
comp_duals3/2Compute the dual for a single positive literal.Source
define_forall/3If BodyVars is empty, just return the original goal.Source
prolog/scasp/compile.pl  -- s(ASP) Ungrounded Stable Models SolverShow source
prolog/scasp/dyncall.pl  -- Show source
#/1Handle s(CASP) directives.Source
#</2Implementation of the s(CASP) constraints.Source
#<>/2Implementation of the s(CASP) constraints.Source
#=/2Implementation of the s(CASP) constraints.Source
#=</2Implementation of the s(CASP) constraints.Source
#>/2Implementation of the s(CASP) constraints.Source
#>=/2Implementation of the s(CASP) constraints.Source
abducible/1Declare Spec, a comma list of heads to be abducible, meaning they can both be in or outside the model.Source
scasp/2Prove query using s(CASP) semantics.Source
scasp_abolish/1Remove all facts for both PredicateIndicator and its classical negation.Source
scasp_assert/1Wrappers 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.Source
scasp_dynamic/1Declare a predicates as dynamic or thread_local.Source
scasp_query_clauses/2Source
scasp_retract/1Wrappers 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.Source
scasp_retractall/1Wrappers 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.Source
scasp_show/2Show some aspect of the translated s(CASP) program.Source
prolog/scasp/embed.pl  -- Embed sCASP programs in Prolog sourcesShow source
gxref_called/2Hook into gxref/0 that may extend the notion of predicates being called by some infrastructure.Source
-/1sCASP classical negation.Source
begin_scasp/1Start an embedded sCASP program.Source
begin_scasp/2Start an embedded sCASP program.Source
end_scasp/0Close begin_scasp/1,2.Source
not/1sCASP NaF negation.Source
scasp_call/1Solve an sCASP goal from the interactive toplevel.Source
scasp_justification/2Justification for the current sCASP answer.Source
scasp_listing/2List the transformed program for Unit.Source
scasp_model/1True when Model represents the current set of true and false literals.Source
scasp_model/2True when Model represents the current set of true and false literals.Source
scasp_stack/1True when Stack represents the justification of the current sCASP answer.Source
prolog/scasp/html.pl  -- Render s(CASP) justification as HTMLShow source
html_bindings/4Print the variable bindings.Source
html_justification_tree/4Convert the tree to HTML.Source
html_model/4Emit the model as HTML terms.Source
html_model_term/4Emit a model term.Source
html_predicate/4Source
html_program/1Source
html_program/3Emit the current program in human format using HTML.Source
html_query/4Emit the query.Source
html_rule/4Source
prolog/scasp/html/html_head.plShow source
prolog/scasp/html/html_tail.plShow source
prolog/scasp/html/jquery_tree.plShow source
prolog/scasp/html_text.pl  -- Switch between HTML and plain text outputShow source
prolog/scasp/human.pl  -- Print s(CASP) output in human languageShow source
human_justification_tree/2Print Tree to current_output in human representation.Source
human_model/2Source
human_predicate/2Source
human_query/2Source
human_rule/2Source
prolog/scasp/input.pl  -- Read SASP source codeShow source
prolog/scasp/json.plShow source
scasp_results_json/2Generate a JSON document from the results of the s(CASP) solver.Source
prolog/scasp/lang/en.plShow source
prolog/scasp/lang/nl.plShow source
prolog/scasp/listing.plShow source
scasp_code_section_title/3Source
scasp_portray_program/1Output pretty print of the program + dual rules + nmr-checks.Source
prolog/scasp/load_compiled.plShow source
prolog/scasp/main.plShow source
main/1Used when calling from command line by passing the command line options and the input files.Source
prolog/scasp/messages.plShow source
scasp_lang/1True when Lang is the language used for messages and justifications.Source
prolog/scasp/model.pl  -- sCASP model handlingShow source
canonical_model/2Source
print_model/2Print the model in aligned columns.Source
unqualify_model/3Restore the model relation to modules.Source
prolog/scasp/modules.pl  -- Encode modulesShow source
encoded_module_term/2Source
model_term_module/2Source
scasp_encoded_module_term/2Map an explicit Prolog module qualification into one that is encoded in the functor name.Source
unqualify_model_term/3Source
prolog/scasp/nmr_check.pl  -- Detect OLON rules and construct nmr_checkShow source
generate_nmr_check/1Get the rules in the program containing odd loops and compute the NMR check.Source
prolog/scasp/ops.plShow source
prolog/scasp/options.pl  -- (Command line) option handling for sCASPShow source
scasp_help/0Print command line option help.Source
scasp_opt_help/2Allow reusing scasp option processing.Source
scasp_opt_meta/2Allow reusing scasp option processing.Source
scasp_opt_type/3Allow reusing scasp option processing.Source
scasp_parse_args/3Select from the list of arguments in Args which are the user-options, Options and which are the program files, Sources.Source
scasp_set_options/1Set Prolog flags that control the solver from Options.Source
scasp_set_options/2Set Prolog flags that control the solver from Options.Source
scasp_version/1print the current version of s(CASP).Source
prolog/scasp/output.pl  -- Emit sCASP termsShow source
connector/3Get an ASCII or Unicode connector string with the claimed Semantics.Source
human_expression/3If there is a human print rule for Atom, return a list of format actions as Actions.Source
inline_constraints/2Get constraints on variables notated as Var | {Constraints} and use assigned variable names.Source
ovar_analyze_term/1Analyze variables in an output term.Source
ovar_analyze_term/2Analyze variables in an output term.Source
ovar_clean/1Delete all attributes added by ovar_analyze_term/1.Source
ovar_is_singleton/1True when Var is a singleton variable.Source
ovar_set_bindings/1Given Bindings as a list of Name=Var, set the names of the variables.Source
ovar_set_name/2Set the name of Var to Name.Source
ovar_var_name/2True when var is not a singleton and has the assigned name.Source
print_model_term/2Print a model element to the terminal.Source
prolog/scasp/pr_rules.pl  -- Output formatting and printing.Show source
prolog/scasp/predicates.pl  -- Basic information about sCASP predicatesShow source
clp_builtin/1Success if Goal is a builtin constraint predicate.Source
clp_interval/1Success if Goal is a builtin constraint predicate to extract interval limits.Source
prolog_builtin/1Success if Goal is a builtin prolog predicate (the compiler introduced its dual).Source
scasp_compiled/1True when Head is part of the transformed representation.Source
table_predicate/1Success if Goal is defined as a tabled predicate with the directive :- table pred/n..Source
user_predicate/1Success if Goal is a user predicate.Source
prolog/scasp/program.pl  -- Input program accessShow source
assert_nmr_check/1Assert the NMR check.Source
assert_program/1Get rules, initial query and called predicates and assert them for easy access.Source
assert_rule/1Assert a program rule.Source
defined_nmr_check/1Dynamic predicate for the list of NMR sub-checks.Source
defined_predicates/1Dynamic predicate for the list of predicate symbols defined in the input program.Source
defined_query/2Dynamic predicate for query.Source
defined_rule/4Dynamic predicate for asserted rules.Source
destroy_program/0Remove all asserted predicates to allow multiple funs with different programs.Source
replace_prefix/4Source
reserved_prefix/1Define reserved prefixes for predicates and compound terms.Source
prolog/scasp/solve.pl  -- The sCASP solverShow source
solve/4Solve the list of sub-goals Goal where StackIn is the list of goals already visited and returns in StackOut the list of goals visited to prove the sub-goals and in Model the model that supports the sub-goals.Source
prolog/scasp/source_ref.pl  -- s(CASP) source referencesShow source
scasp_dynamic_clause_position/2True when Pos is the stream position is which the source code for the dynamic clause referenced by Ref was read.Source
prolog/scasp/stack.plShow source
prolog/scasp/swish.pl  -- s(CASP) adapter for SWISHShow source
post_context/1Called before the other context extraction.Source
post_context/3Bind Var with the context information that belongs to Name.Source
prolog/scasp/variables.pl  -- Variable storage and accessShow source
body_vars/3Get the body variables (variables used in the body but not in the head) for a clause.Source
is_var/1Test an entry to see if it's a variable (the first non-underscore is an upper-case letter.Source
is_var/2Test an entry to see if it's a variable (the first non-underscore is an upper-case letter.Source
revar/3If Term is a term that contains atoms using variable syntax ([A-Z].*), VarTerm is a copy of Term with all such atoms replaced by variables.Source
var_list/2Get a list of N variables, each of which is different.Source
prolog/scasp/verbose.pl  -- Print goal and stack in Ciao compatible formatShow source
print_check_calls_calling/2Auxiliar predicate to print StackIn the current stack and Goal.Source
print_goal/1Print an sCASP goal.Source
scasp_info/2Emit an informational through print_message/2.Source
scasp_trace/2Emit a debug messages through print_message/2.Source
scasp_warning/1Emit a warning through print_message/2.Source
scasp_warning/2Emit a warning through print_message/2.Source
test/all_programs/abdbirds.plShow source
test/all_programs/bec_light.plShow source
test/all_programs/bec_loan.plShow source
test/all_programs/bec_tap_01_overflow.plShow source
test/all_programs/bec_tap_02_no_overflow.plShow source
test/all_programs/bec_tap_03_two_models.plShow source
test/all_programs/bec_tap_04_abducible_infer_event_time.plShow source
test/all_programs/birds.plShow source
test/all_programs/citizenshiptrust-scasp.plShow source
test/all_programs/classic_negation_inconstistent.plShow source
test/all_programs/classic_negation_incostistent.plShow source
test/all_programs/clpq_equality.plShow source
test/all_programs/criminaljustice-scasp.plShow source
test/all_programs/dcc/hamilton_c.plShow source
test/all_programs/family-le-scasp.plShow source
test/all_programs/family.plShow source
test/all_programs/forall_arity.plShow source
test/all_programs/gpa.plShow source
test/all_programs/hamcycle.plShow source
test/all_programs/hamcycle2.plShow source
test/all_programs/hamcycle_two.plShow source
test/all_programs/hanoi.plShow source
test/all_programs/hanoi_7.plShow source
test/all_programs/hanoi_scasp_7.plShow source
test/all_programs/haplotype.plShow source
test/all_programs/impossibleancestor-scasp.plShow source
test/all_programs/isdapermissioncorrected-scasp.plShow source
test/all_programs/itispermittedthat-scasp.plShow source
test/all_programs/left-rec-succ_BAD.plShow source
test/all_programs/lion.plShow source
test/all_programs/list-scasp.plShow source
test/all_programs/loanwithcure-scasp.plShow source
test/all_programs/loop_pos.plShow source
test/all_programs/loop_succ_pos.plShow source
test/all_programs/loopvar.plShow source
test/all_programs/loopvar2.plShow source
test/all_programs/min_model.plShow source
test/all_programs/minicontract-scasp.plShow source
test/all_programs/natnum.plShow source
test/all_programs/obligation-scasp.plShow source
test/all_programs/path_loop.plShow source
test/all_programs/pq.plShow source
test/all_programs/queens.plShow source
test/all_programs/queens_old.plShow source
test/all_programs/rat.plShow source
test/all_programs/sasp/abdbirds.plShow source
test/all_programs/sasp/gpa.plShow source
test/all_programs/sasp/hamcycle.plShow source
test/all_programs/sasp/hamcycle2.plShow source
test/all_programs/sasp/hamcycle_two.plShow source
test/all_programs/sasp/hanoi_7.plShow source
test/all_programs/sasp/left-rec-succ_BAD.plShow source
test/all_programs/sasp/lion.plShow source
test/all_programs/sasp/loop_pos.plShow source
test/all_programs/sasp/loop_succ_pos.plShow source
test/all_programs/sasp/loopvar.plShow source
test/all_programs/sasp/loopvar2.plShow source
test/all_programs/sasp/natnum.plShow source
test/all_programs/sasp/path_loop.plShow source
test/all_programs/sasp/queens_old.plShow source
test/all_programs/simpleRPS-scasp.plShow source
test/all_programs/solve_findall.plShow source
test/all_programs/subset-scasp.plShow source
test/all_programs/turingcomplete-scasp.plShow source
test/all_programs/vars.plShow source
test/diff.plShow source
test/le_programs/citizenshiptrust-scasp.plShow source
test/le_programs/criminaljustice-scasp.plShow source
test/le_programs/family-le-scasp.plShow source
test/le_programs/impossibleancestor-scasp.plShow source
test/le_programs/isdapermissioncorrected-scasp.plShow source
test/le_programs/itispermittedthat-scasp.plShow source
test/le_programs/list-scasp.plShow source
test/le_programs/loanwithcure-scasp.plShow source
test/le_programs/minicontract-scasp.plShow source
test/le_programs/obligation-scasp.plShow source
test/le_programs/simpleRPS-scasp.plShow source
test/le_programs/subset-scasp.plShow source
test/le_programs/turingcomplete-scasp.plShow source
test/min_programs/bec_loan.plShow source
test/min_programs/bec_tap_04_abducible_infer_event_time.plShow source
test/min_programs/clpq_gt_gte_lt_lte_equal.plShow source
test/min_programs/clpq_intercept.plShow source
test/min_programs/ex01-dual.plShow source
test/min_programs/ex02-member.plShow source
test/min_programs/forall_arity.plShow source
test/min_programs/hamiltonian_scasp.plShow source
test/min_programs/lion.plShow source
test/min_programs/nixon-diamond.plShow source
test/min_programs/queens_old.plShow source
test/min_programs/solve_call.plShow source
test/min_programs/solve_findall_superset.plShow source
test/min_programs/solve_forall.plShow source
test/min_programs/solve_not_is.plShow source
test/min_programs/solve_not_true.plShow source
test/min_programs/stream_reasoning.plShow source
test/min_programs/yale_shooting_casp_v2.plShow source
test/small_programs/ex01-dual.plShow source
test/small_programs/solve_not_true.plShow source
test/test_clp_disequality.plShow source
test/test_just.plShow source
test/test_scasp.plShow source
run_test/2Compute all stacks and models for File.Source