(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* raw_tacexpr_r and raw_tacexpr = raw_tacexpr_r located and raw_taccase = raw_patexpr * raw_tacexpr and raw_recexpr = (ltac_projection or_relid * raw_tacexpr) list type case_info = type_constant or_tuple type 'a open_match = { opn_match : 'a; opn_branch : (Name.t * Name.t array * 'a) KNmap.t; (** Invariant: should not be empty *) opn_default : Name.t * 'a; } type glb_tacexpr = | GTacAtm of atom | GTacVar of Id.t | GTacRef of ltac_constant | GTacFun of Name.t list * glb_tacexpr | GTacApp of glb_tacexpr * glb_tacexpr list | GTacLet of rec_flag * (Name.t * glb_tacexpr) list * glb_tacexpr | GTacCst of case_info * int * glb_tacexpr list | GTacCse of glb_tacexpr * case_info * glb_tacexpr array * (Name.t array * glb_tacexpr) array | GTacPrj of type_constant * glb_tacexpr * int | GTacSet of type_constant * glb_tacexpr * int * glb_tacexpr | GTacOpn of ltac_constructor * glb_tacexpr list | GTacWth of glb_tacexpr open_match | GTacExt : (_, 'a) Tac2dyn.Arg.tag * 'a -> glb_tacexpr | GTacPrm of ml_tactic_name * glb_tacexpr list (** {5 Parsing & Printing} *) type exp_level = | E5 | E4 | E3 | E2 | E1 | E0 type sexpr = | SexprStr of string located | SexprInt of int located | SexprRec of Loc.t * Id.t option located * sexpr list (** {5 Toplevel statements} *) type strexpr = | StrVal of mutable_flag * rec_flag * (Name.t located * raw_tacexpr) list (** Term definition *) | StrTyp of rec_flag * (qualid located * redef_flag * raw_quant_typedef) list (** Type definition *) | StrPrm of Id.t located * raw_typexpr * ml_tactic_name (** External definition *) | StrSyn of sexpr list * int option * raw_tacexpr (** Syntactic extensions *) | StrMut of qualid located * raw_tacexpr (** Redefinition of mutable globals *) (** {5 Dynamic semantics} *) (** Values are represented in a way similar to OCaml, i.e. they constrast immediate integers (integers, constructors without arguments) and structured blocks (tuples, arrays, constructors with arguments), as well as a few other base cases, namely closures, strings, named constructors, and dynamic type coming from the Coq implementation. *) type tag = int type valexpr = | ValInt of int (** Immediate integers *) | ValBlk of tag * valexpr array (** Structured blocks *) | ValStr of Bytes.t (** Strings *) | ValCls of closure (** Closures *) | ValOpn of KerName.t * valexpr array (** Open constructors *) | ValExt : 'a Tac2dyn.Val.tag * 'a -> valexpr (** Arbitrary data *) and closure = { mutable clos_env : valexpr Id.Map.t; (** Mutable so that we can implement recursive functions imperatively *) clos_var : Name.t list; (** Bound variables *) clos_exp : glb_tacexpr; (** Body *) } type ml_tactic = valexpr list -> valexpr Proofview.tactic type environment = valexpr Id.Map.t