During the trace (not the CHR trace), it is possible to visualise the quantification of the variables.
If SICStus is trying to invoke a goal, e.g.:
Call: module:predicate(A,B,C)
to visualise the quantification of the variables, act as follows.
print_quant(module).
Represents the sciff derivation tree in form of a graph, using the graphviz software.
The file should be opened with init_graph(FileName,Stream)
, and, after the execution of the proof, it should be closed with close_graph
.
The produced file can be opened with DOT and converted in PostScript or other formats.
Default value is off.
From a low-level point of view, the integrity constraints are represented as CHR constraints. If you want to add an IC which is not allowed by the parser, you have to:
in order to set the quantification of a variable X in an integrity constraint, invoke the goal forall(X)
or exists(X)
.
The ic is represented as psic(Body,Head)
, where
remember that all the atoms have a Prolog syntax, i.e., they are lowercase (e.g., happened events are represented as h(Event,T))
For example, if you want to add the following IC:
where for some reason you want Tq quantified existentially and Tr universally, you can invoke the goal:
forall(Tp), forall(Tr), exists(Tq), exists(Ts), psic([[h(p,Tp)],[],[],[],[],[],[],[]],[[en(q,Tq),e(r,Tr)],[e(s,Ts)]]).
Example:
?- forall(Tp), forall(Tr), exists(Tq), exists(Ts), psic([[h(p,Tp)],[],[],[],[],[],[],[]],[[en(q,Tq),e(r,Tr)],[e(s,Ts)]]), h(p,1).
pending(en(q,_A)),
pending(e(r,_B)),
psic([[h(p,Tp)],[],[],[],[],[],[],[]],[[en(q,Tq),e(r,Tr)],[e(s,Ts)]]),
h(p,1),
en(q,_A),
e(r,_B) ? ;
pending(e(s,_A)),
psic([[h(p,Tp)],[],[],[],[],[],[],[]],[[en(q,Tq),e(r,Tr)],[e(s,Ts)]]),
h(p,1),
e(s,_A) ? ;
no
SCIFF can use as ICs files also files represented in RuleML 0.9.
Moreover, SCIFF can convert ICs from the internal representation into RuleML,
using the predicate save_ics_ruleml(FileName)
in the module
ruleml_parser
.
For example, after opening a project (e.g., project(auction)), use the command
ruleml_parser:save_ics_ruleml('ic.ruleml').
to save the ICs in the project to a file ic.ruleml in RuleML format.
The predicate download_ics/1
lets you download an ICS file
from the web. The only parameter is the URL of the ICS file, given as string
(i.e., with double quotes "")
The ICS file
can be either in the ICS syntax, or in RuleML. The ICS are then imposed
(i.e., they are invoked).
A help file is an html file. Each of the topics is indexed with an anchor
The end of the topics is recognised when there is the next topics, i.e., another anchor <a name="next topic"></a> You can link to such anchors, e.g. with <a href="#topics name">topics name</a>
Please, in links use as text the same name as the anchor, as it is used by the help system of SCIFF.