pub enum Phrase {
Show 14 variants
BooleanQuery(PhraseBooleanQuery),
InstanceQuery(PhraseInstanceQuery),
Create(PhraseCreate),
Terminate(PhraseTerminate),
Obfuscate(PhraseObfuscate),
Trigger(PhraseTrigger),
AtomicFact(PhraseAtomicFact),
CompositeFact(PhraseCompositeFact),
Placeholder(PhrasePlaceholder),
Predicate(PhrasePredicate),
Event(PhraseEvent),
Act(PhraseAct),
Duty(PhraseDuty),
Extend(PhraseExtend),
}
Expand description
Represents an eFLINT statement, essentially.
Variants§
BooleanQuery(PhraseBooleanQuery)
Defines a boolean query, e.g.,
? has-voted(Bob, Amy)
InstanceQuery(PhraseInstanceQuery)
Defines an instance query, e.g.,
?- has-voted(voter, Amy)
Create(PhraseCreate)
Postulates a certain fact to be true, e.g.,
+citizen(Amy).
Terminate(PhraseTerminate)
Postulates a certain fact to be false, e.g.,
-citizen(Amy).
Obfuscate(PhraseObfuscate)
Removes the postulation for a certain fact, falling back to its derived value, e.g.,
~citizen(Amy).
Trigger(PhraseTrigger)
Triggers an Event or an Act, e.g.,
vote(Amy, Bob).
AtomicFact(PhraseAtomicFact)
Defines a Fact that has atomic construction, e.g.,
Fact citizen Identified by String.
CompositeFact(PhraseCompositeFact)
Defines a Fact that has composite fields, e.g.,
Fact voter Identified by citizen.
Placeholder(PhrasePlaceholder)
Defines a Placeholder to create type aliases, e.g.,
Placeholder civilian For citizen.
Predicate(PhrasePredicate)
Defines a Predicate that can be used to “prepare” queries, e.g.,:
Predicate vote-concluded When Not(Exists citizen : voter(citizen) && !has-voted(citizen)).
This includes invariants, which are checked after every derivation procedure and can trigger violations when becoming false, e.g.,
Invariant at-most-one-winner When Not(Exists winner, winner' : winner != winner').
Event(PhraseEvent)
Defines an Event that can be used to automatically postulate facts, e.g.,:
Event fire Obfuscates vote.
Act(PhraseAct)
Defines an Act that can be used to automatically postulate facts while noting it was instantiated by a particular actor, e.g.:
Act murder
Actor citizen1
Related to citizen2
Terminates citizen2
Duty(PhraseDuty)
Defines a Duty that can be violated when certain conditions are (not) met, e.g.:
Duty must-vote
Holder citizen
Claimant administrator
Enforced by not-voted.
Extend(PhraseExtend)
Defines an extension to an existing type, e.g.:
Extend Duty duty-to-vote
Conditioned by can-vote(voter).
Implementations§
Source§impl Phrase
impl Phrase
Sourcepub fn subclass(&self) -> PhraseSubclass
pub fn subclass(&self) -> PhraseSubclass
Returns the phrase subclass for this phrase.
§Returns
A PhraseSubclass
describing the class of this data.