package lambdapi

All checked builds pass
  1. Overview
  2. Docs
Proof assistant for the λΠ-calculus modulo rewriting

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lambdapi-4.0.0.tbz
sha256=0e2e73e0ea0c674f1263bf85ed3453ed3d6084d38eea29974a03ba9e382d29d7
sha512=2831db57fcd09206687a92fc9ee7d363e87bcec5167949e9c8161d41c63d5887b9f3556bfd63a7a9a0c12e5a5dc61a397baf4f496ebdb2a2fce122142c05e7a1

doc/lambdapi.core/Core/Eval/index.html

Module Core.EvalSource

Evaluation and conversion.

Preliminary remarks. We define the head-structure of a term t as:

  • λx:_,h if t=λx:a,u and h is the head-structure of u
  • Π if t=Πx:a,u
  • h _ if t=uv and h is the head-structure of u
  • ? if t=?M.t1;...;tn (and ?M is not instantiated)
  • t itself otherwise (TYPE, KIND, x, f)

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.

Sourceval eta_equality : bool Timed.ref

Flag indicating whether eta-reduction should be used or not.

Sourcetype rw_tag =
  1. | NoBeta
    (*

    If true, no beta-reduction is performed.

    *)
  2. | NoRw
    (*

    If true, no user-defined rewrite rule is used.

    *)
  3. | NoExpand
    (*

    If 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.

  • If the argument is not given, then no tag is active and the rewrite engine is not constrained: it uses user defined reduction rules, it expands variable definitions (that are stored in the ctxt) and performs beta reductions.
  • Each tag if present disables some functionality of the rewrite engine. The descriptions of the functionalities are given in the documentation of 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.

Sourceval whnf : ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term

whnf ?tags c t computes a whnf of the term t in context c.

Sourceval whnf_opt : ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term option

whnf_opt ?tags c t returns None if t is in whnf, and Some u where u is some whnf of t otherwise.

Sourceval eq_modulo : ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term -> bool

eq_modulo c a b tests the convertibility of a and b in context c.

Sourceval pure_eq_modulo : ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term -> bool

pure_eq_modulo c a b tests the convertibility of a and b in context c with no side effects.

Sourceval snf : ?dtree:(Term.sym -> Term.dtree) -> ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term

snf ~dtree ~tags c t computes a snf of t, unfolding the variables defined in the context c. The function dtree maps symbols to decision trees.

Sourceval snf_beta : Term.term -> Term.term
Sourceval snf_opt : ?dtree:(Term.sym -> Term.dtree) -> ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term option

snf_opt ~dtree ~tags c t computes the snf of t in the context c. The function dtree maps symbols to decision trees.

Sourceval hnf : ?tags:rw_tag list -> Term.ctxt -> Term.term -> Term.term

hnf ?tags c t computes a head-normal form of the term t in context c.

Sourceval unfold_sym : Term.sym -> Term.term -> Term.term

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.

Sourceval unfold_sym_opt : Term.sym -> Term.term -> Term.term option
Sourcetype strategy =
  1. | WHNF
    (*

    Reduce to weak head-normal form.

    *)
  2. | HNF
    (*

    Reduce to head-normal form.

    *)
  3. | SNF
    (*

    Reduce to strong normal form.

    *)
  4. | NONE
    (*

    Do nothing.

    *)

Dedukti evaluation strategies.

Sourcetype strat = {
  1. strategy : strategy;
    (*

    Evaluation strategy.

    *)
  2. steps : int option;
    (*

    Max number of steps if given.

    *)
}

eval s c t evaluates the term t in the context c according to strategy s.