pub enum Statement<'a> {
Domain(Located<'a, &'a str>),
Import {
path: Located<'a, &'a str>,
alias: Option<Located<'a, &'a str>>,
},
Fact(Located<'a, Atom<'a>>),
Negation(Located<'a, Atom<'a>>),
Assume(Located<'a, Literal<'a>>),
Set {
name: Located<'a, &'a str>,
elements: Vec<Located<'a, &'a str>>,
},
Close {
relation: Located<'a, &'a str>,
kind: CloseKind,
},
Premise {
name: Located<'a, &'a str>,
quant: Option<Quant<'a>>,
body: Body<'a>,
},
Rule {
name: Located<'a, &'a str>,
quant: Option<Quant<'a>>,
body: Body<'a>,
},
Check {
subject: Option<Located<'a, &'a str>>,
bidirectional: bool,
},
}Expand description
A top-level statement.
Variants§
Domain(Located<'a, &'a str>)
DOMAIN <name> — declare the domain this file’s atoms belong to. Required
once per file, as the first statement; it is the identity namespace into
which bare atoms fall.
Import
IMPORT "path" [AS <alias>] — reuse another source (resolved by the
compiler). The optional alias is the local name the imported domain is
referenced by; without it, the imported file’s own declared domain name is
used.
Fields
Fact(Located<'a, Atom<'a>>)
FACT <atom> — a TRUE assertion.
Negation(Located<'a, Atom<'a>>)
NOT <atom> — a FALSE assertion.
Assume(Located<'a, Literal<'a>>)
ASSUME [NOT] <atom> — a soft (retractable) assertion. Same shape as a
FACT/NOT, but it is a hypothesis, not a commitment: when the
assumptions cannot all hold the solver names which to drop, and it never
blames a FACT/PREMISE. The Literal carries the optional NOT.
Set
SET <name> then one element identifier per line — declare a finite set
to quantify a PREMISE/RULE over via FOR EACH <binder> IN <name>.
Fields
Close
CLOSE <relation> TRANSITIVE — close a relation’s FACT pairs under the
given kind at compile time (a graph operation, no solver cost). A cycle is
a compile error.
Fields
Premise
PREMISE <name> [FOR EACH …]: ... — a checked first principle, optionally
quantified over a declared set.
Fields
Rule
RULE <name> [FOR EACH …]: ... — a fact-producing inference rule.
Fields
Check
CHECK [subject] [BIDIRECTIONAL] — a query.