Core.EvalSourceEvaluation and conversion.
Preliminary remarks. We define the head-structure of a term t as:
t1;...;tn (and ?M is not instantiated)A term t is in head-normal form (hnf) if its head-structure is invariant by reduction.
A term t is in weak head-normal form (whnf) if it is an abstraction or if it is in hnf. In particular, a term in head-normal form is in weak head-normal form.
A term t is in strong normal form (snf) if it cannot be reduced further.
Flag indicating whether eta-reduction should be used or not.
type rw_tag = [ | `NoBetaIf true, no beta-reduction is performed.
*)| `NoRwIf true, no user-defined rewrite rule is used.
*)| `NoExpandIf true, definitions are not expanded.
*) ]Tags for rewriting configuration.
Functions that use the rewriting engine and accept an optional argument tags of type rw_tag list have the following behaviour.
ctxt) and performs beta reductions.rw_tag.Reduction functions also accept an optional problem that is used to store metavariables that may be created while rewriting. Such metavariables may be created by particular rewrite rules (such as unification rules), but not by rules declared with rule t ↪ u;.
NOTE that all reduction functions, and eq_modulo, may reduce in-place some subterms of the reduced term.
whnf ?problem ?tags c t computes a whnf of the term t in context c.
eq_modulo c a b tests the convertibility of a and b in context c.
pure_eq_modulo c a b tests the convertibility of a and b in context c with no side effects.
snf ?problem ?tags c t computes the strong normal form of the term t in the context c.
hnf ?problem ?tags c t computes a head-normal form of the term t in context c.
simplify t computes a beta whnf of t belonging to the set S such that:
t is a product, then both its domain and codomain are in S.If s is a non-opaque symbol having a definition, unfold_sym s t replaces in t all the occurrences of s by its definition.
Dedukti evaluation strategies.