summaryrefslogtreecommitdiff
path: root/src/ast.ml
diff options
context:
space:
mode:
authorPeter Sewell2013-09-05 15:21:42 +0100
committerPeter Sewell2013-09-05 15:21:42 +0100
commitcf4c7c0fd5fb8a9851fa6ca325d1b106ff080fd5 (patch)
treed2fee1e6801f498c8b84aff76503fde16db90eb7 /src/ast.ml
parent635a3619d41c4659005922a19210fe48e551f81a (diff)
workaround likely aux rule bug
Diffstat (limited to 'src/ast.ml')
-rw-r--r--src/ast.ml154
1 files changed, 77 insertions, 77 deletions
diff --git a/src/ast.ml b/src/ast.ml
index fe990be3..2be8a5b7 100644
--- a/src/ast.ml
+++ b/src/ast.ml
@@ -72,16 +72,6 @@ kinded_id_aux = (* optionally kind-annotated identifier *)
type
-nexp_constraint =
- NC_aux of nexp_constraint_aux * l
-
-
-type
-kinded_id =
- KOpt_aux of kinded_id_aux * l
-
-
-type
efct_aux = (* effect *)
Effect_rreg (* read register *)
| Effect_wreg (* write register *)
@@ -93,9 +83,13 @@ efct_aux = (* effect *)
type
-quant_item_aux = (* Either a kinded identifier or a nexp constraint for a typquant *)
- QI_id of kinded_id (* An optionally kinded identifier *)
- | QI_const of nexp_constraint (* A constraint for this type *)
+nexp_constraint =
+ NC_aux of nexp_constraint_aux * l
+
+
+type
+kinded_id =
+ KOpt_aux of kinded_id_aux * l
type
@@ -104,8 +98,9 @@ efct =
type
-quant_item =
- QI_aux of quant_item_aux * l
+quant_item_aux = (* Either a kinded identifier or a nexp constraint for a typquant *)
+ QI_id of kinded_id (* An optionally kinded identifier *)
+ | QI_const of nexp_constraint (* A constraint for this type *)
type
@@ -122,9 +117,8 @@ effects_aux = (* effect set, of kind $_$ *)
type
-typquant_aux = (* type quantifiers and constraints *)
- TypQ_tq of (quant_item) list
- | TypQ_no_forall (* sugar, omitting quantifier and constraints *)
+quant_item =
+ QI_aux of quant_item_aux * l
type
@@ -138,8 +132,9 @@ effects =
type
-typquant =
- TypQ_aux of typquant_aux * l
+typquant_aux = (* type quantifiers and constraints *)
+ TypQ_tq of (quant_item) list
+ | TypQ_no_forall (* sugar, omitting quantifier and constraints *)
type
@@ -164,6 +159,11 @@ and typ_arg =
type
+typquant =
+ TypQ_aux of typquant_aux * l
+
+
+type
lit_aux = (* Literal constant *)
L_unit (* $() : _$ *)
| L_zero (* $_ : _$ *)
@@ -281,16 +281,6 @@ and 'a letbind =
type
-ne = (* internal numeric expressions *)
- Ne_var of id
- | Ne_const of int
- | Ne_mult of ne * ne
- | Ne_add of ne * ne
- | Ne_exp of ne
- | Ne_unary of ne
-
-
-type
naming_scheme_opt_aux = (* Optional variable-naming-scheme specification for variables of defined type *)
Name_sect_none
| Name_sect_some of string
@@ -302,8 +292,9 @@ type
type
-'a funcl_aux = (* Function clause *)
- FCL_Funcl of id * 'a pat * 'a exp
+rec_opt_aux = (* Optional recursive annotation for functions *)
+ Rec_nonrec (* non-recursive *)
+ | Rec_rec (* recursive *)
type
@@ -313,31 +304,18 @@ type
type
-rec_opt_aux = (* Optional recursive annotation for functions *)
- Rec_nonrec (* non-recursive *)
- | Rec_rec (* recursive *)
-
-
-type
-k = (* Internal kinds *)
- Ki_typ
- | Ki_nat
- | Ki_ord
- | Ki_efct
- | Ki_val (* Representing values, for use in identifier checks *)
- | Ki_ctor of (k) list * k
- | Ki_infer (* Representing an unknown kind, inferred by context *)
+'a funcl_aux = (* Function clause *)
+ FCL_Funcl of id * 'a pat * 'a exp
type
-t_arg = (* Argument to type constructors *)
- Typ of t
- | Nexp of ne
- | Effect of effects
- | Order of order
-
-and t_args = (* Arguments to type constructors *)
- T_args of (t_arg) list
+ne = (* internal numeric expressions *)
+ Ne_var of id
+ | Ne_const of int
+ | Ne_mult of ne * ne
+ | Ne_add of ne * ne
+ | Ne_exp of ne
+ | Ne_unary of ne
type
@@ -361,8 +339,8 @@ type
type
-'a funcl =
- FCL_aux of 'a funcl_aux * 'a annot
+rec_opt =
+ Rec_aux of rec_opt_aux * l
type
@@ -371,8 +349,30 @@ type
type
-rec_opt =
- Rec_aux of rec_opt_aux * l
+'a funcl =
+ FCL_aux of 'a funcl_aux * 'a annot
+
+
+type
+k = (* Internal kinds *)
+ Ki_typ
+ | Ki_nat
+ | Ki_ord
+ | Ki_efct
+ | Ki_val (* Representing values, for use in identifier checks *)
+ | Ki_ctor of (k) list * k
+ | Ki_infer (* Representing an unknown kind, inferred by context *)
+
+
+type
+t_arg = (* Argument to type constructors *)
+ Typ of t
+ | Nexp of ne
+ | Effect of effects
+ | Order of order
+
+and t_args = (* Arguments to type constructors *)
+ T_args of (t_arg) list
type
@@ -385,12 +385,6 @@ type
type
-'a default_typing_spec_aux = (* Default kinding or typing assumption *)
- DT_kind of base_kind * id
- | DT_typ of typschm * id
-
-
-type
'a fundef_aux = (* Function definition *)
FD_function of rec_opt * 'a tannot_opt * 'a effects_opt * ('a funcl) list
@@ -401,13 +395,14 @@ type
type
-'a type_def =
- TD_aux of 'a type_def_aux * 'a annot
+'a default_typing_spec_aux = (* Default kinding or typing assumption *)
+ DT_kind of base_kind * id
+ | DT_typ of typschm * id
type
-'a default_typing_spec =
- DT_aux of 'a default_typing_spec_aux * 'a annot
+'a type_def =
+ TD_aux of 'a type_def_aux * 'a annot
type
@@ -421,6 +416,11 @@ type
type
+'a default_typing_spec =
+ DT_aux of 'a default_typing_spec_aux * 'a annot
+
+
+type
'a def_aux = (* Top-level definition *)
DEF_type of 'a type_def (* type definition *)
| DEF_fundef of 'a fundef (* function definition *)
@@ -436,11 +436,6 @@ type
type
-'a ctor_def_aux = (* Datatype constructor definition clause *)
- CT_ct of id * typschm
-
-
-type
'a typ_lib_aux = (* library types and syntactic sugar for them *)
Typ_lib_unit (* unit type with value $()$ *)
| Typ_lib_bool (* booleans $_$ and $_$ *)
@@ -459,13 +454,13 @@ type
type
-'a def =
- DEF_aux of 'a def_aux * 'a annot
+'a ctor_def_aux = (* Datatype constructor definition clause *)
+ CT_ct of id * typschm
type
-'a ctor_def =
- CT_aux of 'a ctor_def_aux * 'a annot
+'a def =
+ DEF_aux of 'a def_aux * 'a annot
type
@@ -474,6 +469,11 @@ type
type
+'a ctor_def =
+ CT_aux of 'a ctor_def_aux * 'a annot
+
+
+type
'a defs = (* Definition sequence *)
Defs of ('a def) list