Kernel.RuleSourceRewrite rules
type pattern = | Var of Basic.loc * Basic.ident * int * pattern listApplied DB variable
*)| Pattern of Basic.loc * Basic.name * pattern listApplied constant
*)| Lambda of Basic.loc * Basic.ident * patternLambda abstraction
*)| Brackets of Term.termBracket of a term
*)Basic representation of pattern
type wf_pattern = | LJoker| LVar of Basic.ident * int * int listApplied Miller variable
*)| LLambda of Basic.ident * wf_patternLambda abstraction
*)| LPattern of Basic.name * wf_pattern arrayApplied constant
*)| LBoundVar of Basic.ident * int * wf_pattern arrayLocally bound variable
*)| LACSet of Basic.name * wf_pattern listEfficient representation for well-formed linear Miller pattern
constr is the type of brackets (aka "dot") pattern constraints. They are generated by the function check_patterns. (i,te) means meta variable of DB index i should be convertible with te
type rule_name = | Beta| Delta of Basic.nameRules associated to the definition of a constant
*)| Gamma of bool * Basic.nameRules of lambda pi modulo. The first parameter indicates whether the name of the rule has been given by the user.
*)A rule is formed with
Rule where context is partially annotated with types
type rule_error = | BoundVariableExpected of Basic.loc * pattern| DistinctBoundVariablesExpected of Basic.loc * Basic.ident| VariableBoundOutsideTheGuard of Basic.loc * Term.term| UnboundVariable of Basic.loc * Basic.ident * pattern| AVariableIsNotAPattern of Basic.loc * Basic.ident| NonLinearNonEqArguments of Basic.loc * Basic.ident| NotEnoughArguments of Basic.loc * Basic.ident * int * int * int| NonLinearRule of Basic.loc * rule_nametype rule_infos = {l : Basic.loc;location of the rule
*)name : rule_name;name of the rule
*)nonlinear : int list;DB indices of non linear variables. Empty if the rule is linear ?
*)cst : Basic.name;name of the pattern constant
*)args : pattern list;arguments list of the pattern constant
*)rhs : Term.term;right hand side of the rule
*)ctx_size : int;size of the context of the non-linear version of the rule
*)esize : int;size of the context of the linearized, bracket free version of the rule
*)pats : wf_pattern array;free patterns without constraint
*)arity : int array;arities of context variables
*)constraints : constr list;constraints generated from the pattern to the free pattern
*)}Extracts arity context from a rule info
Extracts LHS pattern from a rule info
Converts any rule (typed or untyped) to rule_infos
Converts rule_infos representation to a rule where the context is annotated with the variables' arity