aboutsummaryrefslogtreecommitdiffhomepage
path: root/intf
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-05-29 11:08:44 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-05-29 11:08:44 +0000
commita936f2e879ac1f9b2e7e9d8a5376469e3d53c606 (patch)
tree7f0972729eb41828ad9abbaf0dc61ce2366ef870 /intf
parentb31b48407a9f5d36cefd6dec3ddf3e0b8391f14c (diff)
Glob_term now mli-only, operations now in Glob_ops
Stuff about reductions now in genredexpr.mli, operations in redops.ml git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15374 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'intf')
-rw-r--r--intf/genredexpr.mli48
-rw-r--r--intf/glob_term.mli74
-rw-r--r--intf/misctypes.mli7
-rw-r--r--intf/tacexpr.mli21
4 files changed, 131 insertions, 19 deletions
diff --git a/intf/genredexpr.mli b/intf/genredexpr.mli
new file mode 100644
index 000000000..8aab193fd
--- /dev/null
+++ b/intf/genredexpr.mli
@@ -0,0 +1,48 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(** Reduction expressions *)
+
+(** The parsing produces initially a list of [red_atom] *)
+
+type 'a red_atom =
+ | FBeta
+ | FIota
+ | FZeta
+ | FConst of 'a list
+ | FDeltaBut of 'a list
+
+(** This list of atoms is immediately converted to a [glob_red_flag] *)
+
+type 'a glob_red_flag = {
+ rBeta : bool;
+ rIota : bool;
+ rZeta : bool;
+ rDelta : bool; (** true = delta all but rConst; false = delta only on rConst*)
+ rConst : 'a list
+}
+
+(** Generic kinds of reductions *)
+
+type ('a,'b,'c) red_expr_gen =
+ | Red of bool
+ | Hnf
+ | Simpl of 'c Locus.with_occurrences option
+ | Cbv of 'b glob_red_flag
+ | Lazy of 'b glob_red_flag
+ | Unfold of 'b Locus.with_occurrences list
+ | Fold of 'a list
+ | Pattern of 'a Locus.with_occurrences list
+ | ExtraRedExpr of string
+ | CbvVm of 'c Locus.with_occurrences option
+
+type ('a,'b,'c) may_eval =
+ | ConstrTerm of 'a
+ | ConstrEval of ('a,'b,'c) red_expr_gen * 'a
+ | ConstrContext of (Pp.loc * Names.identifier) * 'a
+ | ConstrTypeOf of 'a
diff --git a/intf/glob_term.mli b/intf/glob_term.mli
new file mode 100644
index 000000000..93f391afa
--- /dev/null
+++ b/intf/glob_term.mli
@@ -0,0 +1,74 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(** Untyped intermediate terms *)
+
+(** [glob_constr] comes after [constr_expr] and before [constr].
+
+ Resolution of names, insertion of implicit arguments placeholder,
+ and notations are done, but coercions, inference of implicit
+ arguments and pattern-matching compilation are not. *)
+
+open Pp
+open Names
+open Sign
+open Term
+open Libnames
+open Decl_kinds
+open Misctypes
+
+(** The kind of patterns that occurs in "match ... with ... end"
+
+ locs here refers to the ident's location, not whole pat *)
+type cases_pattern =
+ | PatVar of loc * name
+ | PatCstr of loc * constructor * cases_pattern list * name
+ (** [PatCstr(p,C,l,x)] = "|'C' 'l' as 'x'" *)
+
+type glob_constr =
+ | GRef of (loc * global_reference)
+ | GVar of (loc * identifier)
+ | GEvar of loc * existential_key * glob_constr list option
+ | GPatVar of loc * (bool * patvar) (** Used for patterns only *)
+ | GApp of loc * glob_constr * glob_constr list
+ | GLambda of loc * name * binding_kind * glob_constr * glob_constr
+ | GProd of loc * name * binding_kind * glob_constr * glob_constr
+ | GLetIn of loc * name * glob_constr * glob_constr
+ | GCases of loc * case_style * glob_constr option * tomatch_tuples * cases_clauses
+ (** [GCases(l,style,r,tur,cc)] = "match 'tur' return 'r' with 'cc'" (in
+ [MatchStyle]) *)
+
+ | GLetTuple of loc * name list * (name * glob_constr option) *
+ glob_constr * glob_constr
+ | GIf of loc * glob_constr * (name * glob_constr option) * glob_constr * glob_constr
+ | GRec of loc * fix_kind * identifier array * glob_decl list array *
+ glob_constr array * glob_constr array
+ | GSort of loc * glob_sort
+ | GHole of (loc * Evar_kinds.t)
+ | GCast of loc * glob_constr * glob_constr cast_type
+
+and glob_decl = name * binding_kind * glob_constr option * glob_constr
+
+and fix_recursion_order = GStructRec | GWfRec of glob_constr | GMeasureRec of glob_constr * glob_constr option
+
+and fix_kind =
+ | GFix of ((int option * fix_recursion_order) array * int)
+ | GCoFix of int
+
+and predicate_pattern =
+ name * (loc * inductive * name list) option
+ (** [(na,id)] = "as 'na' in 'id'" where if [id] is [Some(l,I,k,args)]. *)
+
+and tomatch_tuple = (glob_constr * predicate_pattern)
+
+and tomatch_tuples = tomatch_tuple list
+
+and cases_clause = (loc * identifier list * cases_pattern list * glob_constr)
+(** [(p,il,cl,t)] = "|'cl' as 'il' => 't'" *)
+
+and cases_clauses = cases_clause list
diff --git a/intf/misctypes.mli b/intf/misctypes.mli
index 9d6820346..2aec5ed32 100644
--- a/intf/misctypes.mli
+++ b/intf/misctypes.mli
@@ -27,6 +27,13 @@ type intro_pattern_expr =
| IntroAnonymous
and or_and_intro_pattern_expr = (Pp.loc * intro_pattern_expr) list list
+(** Move destination for hypothesis *)
+
+type 'id move_location =
+ | MoveAfter of 'id
+ | MoveBefore of 'id
+ | MoveFirst
+ | MoveLast (** can be seen as "no move" when doing intro *)
(** Sorts *)
diff --git a/intf/tacexpr.mli b/intf/tacexpr.mli
index 16ba9f95e..d8e340d1e 100644
--- a/intf/tacexpr.mli
+++ b/intf/tacexpr.mli
@@ -10,15 +10,13 @@ open Names
open Topconstr
open Libnames
open Nametab
-open Glob_term
-open Errors
-open Pp
-open Util
+open Genredexpr
open Genarg
open Pattern
open Decl_kinds
open Misctypes
open Locus
+open Pp
type 'a or_metaid = AI of 'a | MetaId of loc * string
@@ -33,21 +31,6 @@ type letin_flag = bool (* true = use local def false = use Leibniz *)
type debug = Debug | Info | Off (* for trivial / auto / eauto ... *)
-type glob_red_flag =
- | FBeta
- | FIota
- | FZeta
- | FConst of reference or_by_notation list
- | FDeltaBut of reference or_by_notation list
-
-type 'a raw_hyp_location = 'a with_occurrences * hyp_location_flag
-
-type 'id move_location =
- | MoveAfter of 'id
- | MoveBefore of 'id
- | MoveFirst
- | MoveLast (* can be seen as "no move" when doing intro *)
-
type 'a induction_arg =
| ElimOnConstr of 'a
| ElimOnIdent of identifier located