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>>),
Premise {
name: Located<'a, &'a str>,
body: Body<'a>,
},
Rule {
name: Located<'a, &'a str>,
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.
Premise
PREMISE <name>: ... — a checked first principle.
Fields
Rule
RULE <name>: ... — a fact-producing inference rule.
Fields
Check
CHECK [subject] [BIDIRECTIONAL] — a query.