Baskerville.Rule
- Package
- purescript-baskerville-core
- Repository
- afcondon/purescript-baskerville
The rule eDSL: rule bodies as nondeterministic queries over the KB that cite their premises automatically.
The ergonomic point: in prim form the author looks up and threads
FactIds by hand, and a forgotten citation silently weakens the proof
term. Here matches and require both test a claim and cite the
fact recording it — the derivation writes itself.
absent is negation as failure: sound at the fixpoint within a
stratum, and it cites nothing (there is no fact to cite — that is the
nature of negative knowledge in a monotone system). Stratification
checking arrives with the analyzable layer; until then the client
vouches, exactly as with prim rules' read-sets.
This is the pragmatic monadic tier from the design sketch: fully expressive, not yet statically analyzable. The naive engine needs no read-sets; when the semi-naive engine lands, eDSL rules grow theirs by interpretation and prim rules keep declaring them.
#RuleM Source
newtype RuleM residue claim rule axiom aA nondeterministic KB query accumulating the premises and anchors it touched along each branch.
Instances
Functor (RuleM residue claim rule axiom)Apply (RuleM residue claim rule axiom)Applicative (RuleM residue claim rule axiom)Bind (RuleM residue claim rule axiom)Monad (RuleM residue claim rule axiom)Alt (RuleM residue claim rule axiom)Plus (RuleM residue claim rule axiom)Alternative (RuleM residue claim rule axiom)