All predicatesShow sourcepr_rules.pl -- Output formatting and printing.

Predicates related to formatting and printing output. This includes predicates that may be used for warning and error output.

author
- Kyle Marple
version
- 20170510
license
- BSD-3
 format_term(+EntryIn:compound, -EntryOut:compound, -Constraints:list, +Vars:compound) is det[private]
Format a term for printing.
Arguments:
EntryIn- The initial entry.
EntryOut- The formatted entry.
Constraints- Any constraints on variables in the entry.
Vars- Variable struct for filling in values.
Source format_term_list(+ListIn:compound, -ListOut:compound) is det[private]
Format each term in a list.
Arguments:
ListIn- The initial list.
ListOut- The formatted list.
Source format_predicate2(+EntryIn:compound, -EntryOut:compound) is det[private]
Given a term, remove the arity, strip any prefixes, and process arguments.
Arguments:
EntryIn- The initial entry.
EntryOut- The formatted entry.
Source format_predicate3(+ArgsIn:list, -ArgsOut:list) is det[private]
Process a list of predicate args or variable constraints.
Arguments:
ArgsIn- Input args.
ArgsOut- Output args.
Source format_predicate4(+ArgsIn:list, -ArgsOut:list) is det[private]
Process a single predicate arg or variable constraint. Where possible, substitute previously used variables for variables with the same value ID. This makes the final output more readable.
Arguments:
ArgIn- Input arg.
ArgOut- Output arg.
Source strip_prefixes(+FunctorIn:atom, -FunctorOut:atom) is det[private]
Strip any reserved prefixes added during processing. If appropriate, modify the output functor to restore formatting represented by the prefix. To ensure that prefixes added by the user remain intact, this predicate will return after removing a single copy of the dummy prefix, if encountered. Otherwise, all reserved prefixes will be stripped. To prevent errors, the dual rule prefix, if present, should always be first.
Arguments:
FunctorIn- Input functor
FunctorOut- Output functor
Source generate_pr_rules(:Sources, +Options)
Translate the sCASP program from the defined_* predicates into pr_* predicates for sCASP. It creates clauses for the following predicates in the target module:
 assert_pr_table(+Tabled) is det[private]
 assert_pr_show(+Atoms) is det[private]
 process_pr_pred(+PredDecl) is det[private]
Source process_pr_pred(+Spec, -Atom, -Children, -Condition, -Human) is det
Process a #pred Spec :: Template. directive.
Arguments:
Spec- is a term Head::Template, where Head is an sCASP atom where the variables are represented as $(Name) and Template is a string that embeds "@(Var)", "@(Var:Type)", "{{Var}}" or "{{Var:Type}}"
Pred- is a term `Head::format(Fmt, Args)`, where Fmt contains ~p and the arguments are of the shape @($(Var):Type), which is printed as "<Var>, a <Type>"
Source insert_var(+TermIn, -Term, +VarName, +Var) is det[private]
Source atom_cond(+Spec, -Atom, -Children, -Condition) is det[private]
Translate a pred/1 condition. Spec specifies a node in the justification tree. Its general form is AtomSpec-Children, where Children is one of

Each AtomSpec is either a plain Atom, one wrapped, -(Atom) not(Atom) or not(-(Atom)). A condition may be added to an Atom as a conjunction, e.g., this denotes the atom p(X), but only if X is an integer.

:- pred (p(X),integer(X)) :: "bla bla {{X}}".
Source assert_pr_rules(+Rules:list, +Module) is det[private]
Source check_existence(+Options)[private]
Check that all referenced predicates are defined.
Source clean_pr_program(+Module) is det
Prepare Module to receive a compiled sCASP program. This wipes a possibly existing sCASP program. It also relies on the side effect of retractall/1 to create a non-existing predicate as dynamic.