123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500(*Generated by Lem from ast.lem.*)(* generated by Ott 0.34 from: ../../language/sail.ott *)openLem_pervasivestypel=Parse_ast.lopenValuetypeloop=While|Untiltype'aannot=l*'atypeextern={pure:bool;bindings:(string*string)list}typex=string(* identifier *)typeix=string(* infix identifier *)typekid_aux=(* kinded IDs: Type, Int, and Order variables *)|Varofxtypekind_aux=(* base kind *)|K_type(* kind of types *)|K_int(* kind of natural number size expressions *)|K_order(* kind of vector order specifications *)|K_bool(* kind of constraints *)typeid_aux=(* Identifier *)|Idofx|Operatorofx(* remove infix status *)typekid=|Kid_auxofkid_aux*ltypekind=|K_auxofkind_aux*ltypeid=|Id_auxofid_aux*ltypeorder_aux=(* vector order specifications, of kind Order *)|Ord_varofkid(* variable *)|Ord_inc(* increasing *)|Ord_dec(* decreasing *)typekinded_id_aux=(* optionally kind-annotated identifier *)|KOpt_kindofkind*kid(* kind-annotated variable *)typenexp_aux=(* numeric expression, of kind Int *)|Nexp_idofid(* abbreviation identifier *)|Nexp_varofkid(* variable *)|Nexp_constantofNat_big_num.num(* constant *)|Nexp_appofid*nexplist(* app *)|Nexp_timesofnexp*nexp(* product *)|Nexp_sumofnexp*nexp(* sum *)|Nexp_minusofnexp*nexp(* subtraction *)|Nexp_expofnexp(* exponential *)|Nexp_negofnexp(* unary negation *)andnexp=|Nexp_auxofnexp_aux*ltypeorder=|Ord_auxoforder_aux*ltypekinded_id=|KOpt_auxofkinded_id_aux*ltypelit_aux=(* literal constant *)|L_unit|L_zero|L_one|L_true|L_false|L_numofNat_big_num.num(* natural number constant *)|L_hexofstring(* bit vector constant, C-style *)|L_binofstring(* bit vector constant, C-style *)|L_stringofstring(* string constant *)|L_undef(* undefined-value constant *)|L_realofstringtypetyp_aux=(* type expressions, of kind Type *)|Typ_internal_unknown|Typ_idofid(* defined type *)|Typ_varofkid(* type variable *)|Typ_fnoftyplist*typ(* Function (first-order only) *)|Typ_bidiroftyp*typ(* Mapping *)|Typ_tupoftyplist(* Tuple *)|Typ_appofid*typ_arglist(* type constructor application *)|Typ_existofkinded_idlist*n_constraint*typandtyp=|Typ_auxoftyp_aux*landtyp_arg_aux=(* type constructor arguments of all kinds *)|A_nexpofnexp|A_typoftyp|A_orderoforder|A_boolofn_constraintandtyp_arg=|A_auxoftyp_arg_aux*landn_constraint_aux=(* constraint over kind Int *)|NC_equalofnexp*nexp|NC_bounded_geofnexp*nexp|NC_bounded_gtofnexp*nexp|NC_bounded_leofnexp*nexp|NC_bounded_ltofnexp*nexp|NC_not_equalofnexp*nexp|NC_setofkid*Nat_big_num.numlist|NC_orofn_constraint*n_constraint|NC_andofn_constraint*n_constraint|NC_appofid*typ_arglist|NC_varofkid|NC_true|NC_falseandn_constraint=|NC_auxofn_constraint_aux*ltypelit=|L_auxoflit_aux*ltypetyp_pat_aux=(* type pattern *)|TP_wild|TP_varofkid|TP_appofid*typ_patlistandtyp_pat=|TP_auxoftyp_pat_aux*ltypequant_item_aux=(* kinded identifier or Int constraint *)|QI_idofkinded_id(* optionally kinded identifier *)|QI_constraintofn_constraint(* constraint *)type'apat_aux=(* pattern *)|P_litoflit(* literal constant pattern *)|P_wild(* wildcard *)|P_orof('apat)*('apat)(* pattern disjunction *)|P_notof('apat)(* pattern negation *)|P_asof('apat)*id(* named pattern *)|P_typoftyp*('apat)(* typed pattern *)|P_idofid(* identifier *)|P_varof('apat)*typ_pat(* bind pattern to type variable *)|P_appofid*('apat)list(* union constructor pattern *)|P_vectorof('apat)list(* vector pattern *)|P_vector_concatof('apat)list(* concatenated vector pattern *)|P_tupof('apat)list(* tuple pattern *)|P_listof('apat)list(* list pattern *)|P_consof('apat)*('apat)(* Cons patterns *)|P_string_appendof('apat)list(* string append pattern, x ^^ y *)and'apat=|P_auxof('apat_aux)*'aannottypequant_item=|QI_auxofquant_item_aux*ltype'ainternal_loop_measure_aux=(* internal syntax for an optional termination measure for a loop *)|Measure_none|Measure_someof('aexp)and'ainternal_loop_measure=|Measure_auxof('ainternal_loop_measure_aux)*land'aexp_aux=(* expression *)|E_blockof('aexp)list(* sequential block *)|E_idofid(* identifier *)|E_litoflit(* literal constant *)|E_castoftyp*('aexp)(* cast *)|E_appofid*('aexp)list(* function application *)|E_app_infixof('aexp)*id*('aexp)(* infix function application *)|E_tupleof('aexp)list(* tuple *)|E_ifof('aexp)*('aexp)*('aexp)(* conditional *)|E_loopofloop*('ainternal_loop_measure)*('aexp)*('aexp)|E_forofid*('aexp)*('aexp)*('aexp)*order*('aexp)(* for loop *)|E_vectorof('aexp)list(* vector (indexed from 0) *)|E_vector_accessof('aexp)*('aexp)(* vector access *)|E_vector_subrangeof('aexp)*('aexp)*('aexp)(* subvector extraction *)|E_vector_updateof('aexp)*('aexp)*('aexp)(* vector functional update *)|E_vector_update_subrangeof('aexp)*('aexp)*('aexp)*('aexp)(* vector subrange update, with vector *)|E_vector_appendof('aexp)*('aexp)(* vector concatenation *)|E_listof('aexp)list(* list *)|E_consof('aexp)*('aexp)(* cons *)|E_recordof('afexp)list(* struct *)|E_record_updateof('aexp)*('afexp)list(* functional update of struct *)|E_fieldof('aexp)*id(* field projection from struct *)|E_caseof('aexp)*('apexp)list(* pattern matching *)|E_letof('aletbind)*('aexp)(* let expression *)|E_assignof('alexp)*('aexp)(* imperative assignment *)|E_sizeofofnexp(* the value of $nexp$ at run time *)|E_returnof('aexp)(* return $(exp 'a)$ from current function *)|E_exitof('aexp)(* halt all current execution *)|E_refofid|E_throwof('aexp)|E_tryof('aexp)*('apexp)list|E_assertof('aexp)*('aexp)(* halt with error message $(exp 'a)$ when not $(exp 'a)$. exp' is optional. *)|E_varof('alexp)*('aexp)*('aexp)(* This is an internal node for compilation that demonstrates the scope of a local mutable variable *)|E_internal_pletof('apat)*('aexp)*('aexp)(* This is an internal node, used to distinguised some introduced lets during processing from original ones *)|E_internal_returnof('aexp)(* For internal use to embed into monad definition *)|E_internal_valueofvalue(* For internal use in interpreter to wrap pre-evaluated values when returning an action *)|E_internal_assumeofn_constraint*('aexp)(* Internal node for additional type checker assumptions *)|E_constraintofn_constraintand'aexp=|E_auxof('aexp_aux)*'aannotand'alexp_aux=(* lvalue expression *)|LEXP_idofid(* identifier *)|LEXP_derefof('aexp)|LEXP_memoryofid*('aexp)list(* memory or register write via function call *)|LEXP_castoftyp*id|LEXP_tupof('alexp)list(* multiple (non-memory) assignment *)|LEXP_vector_concatof('alexp)list(* vector concatenation L-exp *)|LEXP_vectorof('alexp)*('aexp)(* vector element *)|LEXP_vector_rangeof('alexp)*('aexp)*('aexp)(* subvector *)|LEXP_fieldof('alexp)*id(* struct field *)and'alexp=|LEXP_auxof('alexp_aux)*'aannotand'afexp_aux=(* field expression *)|FE_Fexpofid*('aexp)and'afexp=|FE_auxof('afexp_aux)*'aannotand'apexp_aux=(* pattern match *)|Pat_expof('apat)*('aexp)|Pat_whenof('apat)*('aexp)*('aexp)and'apexp=|Pat_auxof('apexp_aux)*'aannotand'aletbind_aux=(* let binding *)|LB_valof('apat)*('aexp)(* let, implicit type ($(pat 'a)$ must be total) *)and'aletbind=|LB_auxof('aletbind_aux)*'aannottype'ampat_aux=(* Mapping pattern. Mostly the same as normal patterns but only constructible parts *)|MP_litoflit|MP_idofid|MP_appofid*('ampat)list|MP_vectorof('ampat)list|MP_vector_concatof('ampat)list|MP_tupof('ampat)list|MP_listof('ampat)list|MP_consof('ampat)*('ampat)|MP_string_appendof('ampat)list|MP_typof('ampat)*typ|MP_asof('ampat)*idand'ampat=|MP_auxof('ampat_aux)*'aannottypetypquant_aux=(* type quantifiers and constraints *)|TypQ_tqofquant_itemlist|TypQ_no_forall(* empty *)type'ampexp_aux=|MPat_patof('ampat)|MPat_whenof('ampat)*('aexp)typetypquant=|TypQ_auxoftypquant_aux*ltype'apexp_funcl=('apexp)type'ampexp=|MPat_auxof('ampexp_aux)*'aannottypetype_union_aux=(* type union constructors *)|Tu_ty_idoftyp*idtypetannot_opt_aux=(* optional type annotation for functions *)|Typ_annot_opt_none|Typ_annot_opt_someoftypquant*typtype'arec_opt_aux=(* optional recursive annotation for functions *)|Rec_nonrec(* non-recursive *)|Rec_rec(* recursive without termination measure *)|Rec_measureof('apat)*('aexp)(* recursive with termination measure *)type'afuncl_aux=(* function clause *)|FCL_Funclofid*('apexp_funcl)type'amapcl_aux=(* mapping clause (bidirectional pattern-match) *)|MCL_bidirof('ampexp)*('ampexp)|MCL_forwardsof('ampexp)*('aexp)|MCL_backwardsof('ampexp)*('aexp)typetypschm_aux=(* type scheme *)|TypSchm_tsoftypquant*typtypeindex_range_aux=(* index specification, for bitfields in register types *)|BF_singleofnexp(* single index *)|BF_rangeofnexp*nexp(* index range *)|BF_concatofindex_range*index_range(* concatenation of index ranges *)andindex_range=|BF_auxofindex_range_aux*ltypetype_union=|Tu_auxoftype_union_aux*ltypetannot_opt=|Typ_annot_opt_auxoftannot_opt_aux*ltype'arec_opt=|Rec_auxof('arec_opt_aux)*ltype'afuncl=|FCL_auxof('afuncl_aux)*'aannottype'amapcl=|MCL_auxof('amapcl_aux)*'aannottypetypschm=|TypSchm_auxoftypschm_aux*ltypetype_def_aux=(* type definition body *)|TD_abbrevofid*typquant*typ_arg(* type abbreviation *)|TD_recordofid*typquant*(typ*id)list*bool(* struct type definition *)|TD_variantofid*typquant*type_unionlist*bool(* tagged union type definition *)|TD_enumofid*idlist*bool(* enumeration type definition *)|TD_bitfieldofid*typ*(id*index_range)list(* register mutable bitfield type definition *)type'afundef_aux=(* function definition *)|FD_functionof('arec_opt)*tannot_opt*('afuncl)listtype'amapdef_aux=(* mapping definition (bidirectional pattern-match function) *)|MD_mappingofid*tannot_opt*('amapcl)listtypesubst_aux=(* instantiation substitution *)|IS_typofkid*typ(* instantiate a type variable with a type *)|IS_idofid*id(* instantiate an identifier with another identifier *)typeoutcome_spec_aux=(* outcome declaration *)|OV_outcomeofid*typschm*kinded_idlisttype'ainstantiation_spec_aux=|IN_idofidtypeval_spec_aux=VS_val_specoftypschm*id*externoption*booltypedefault_spec_aux=(* default kinding or typing assumption *)|DT_orderofordertype'ascattered_def_aux=(* scattered function and union type definitions *)|SD_functionof('arec_opt)*tannot_opt*id(* scattered function definition header *)|SD_funclof('afuncl)(* scattered function definition clause *)|SD_variantofid*typquant(* scattered union definition header *)|SD_unionclofid*type_union(* scattered union definition member *)|SD_mappingofid*tannot_opt|SD_mapclofid*('amapcl)|SD_endofid(* scattered definition end *)type'adec_spec_aux=(* register declarations *)|DEC_regoftyp*id*('aexp)optiontype'aopt_default_aux=(* optional default value for indexed vector expressions *)|Def_val_empty|Def_val_decof('aexp)type'aimpldef_aux=(* impl for target *)|Impl_implof('afuncl)type'atype_def=TD_auxoftype_def_aux*'aannottype'afundef=|FD_auxof('afundef_aux)*'aannottype'amapdef=|MD_auxof('amapdef_aux)*'aannottypesubst=|IS_auxofsubst_aux*ltypeoutcome_spec=|OV_auxofoutcome_spec_aux*ltype'ainstantiation_spec=|IN_auxof('ainstantiation_spec_aux)*'aannottype'aval_spec=VS_auxofval_spec_aux*'aannottypedefault_spec=|DT_auxofdefault_spec_aux*ltype'ascattered_def=|SD_auxof('ascattered_def_aux)*'aannottype'adec_spec=|DEC_auxof('adec_spec_aux)*'aannottypeprec=|Infix|InfixL|InfixRtype'aloop_measure=|Loopofloop*('aexp)type'aopt_default=|Def_val_auxof('aopt_default_aux)*'aannottype'aimpldef=|Impl_auxof('aimpldef_aux)*ltypecast_opt=booltype'adef=(* top-level definition *)|DEF_typeof'atype_def(* type definition *)|DEF_fundefof('afundef)(* function definition *)|DEF_mapdefof('amapdef)(* mapping definition *)|DEF_implof('afuncl)(* impl definition *)|DEF_valof('aletbind)(* value definition *)|DEF_specof'aval_spec(* top-level type constraint *)|DEF_outcomeofoutcome_spec*('adef)list(* top-level outcome definition *)|DEF_instantiationof('ainstantiation_spec)*substlist(* instantiation *)|DEF_fixityofprec*Nat_big_num.num*id(* fixity declaration *)|DEF_overloadofid*idlist(* operator overload specification *)|DEF_defaultofdefault_spec(* default kind and type assumptions *)|DEF_scatteredof('ascattered_def)(* scattered function and type definition *)|DEF_measureofid*('apat)*('aexp)(* separate termination measure declaration *)|DEF_loop_measuresofid*('aloop_measure)list(* separate termination measure declaration *)|DEF_reg_decof('adec_spec)(* register declaration *)|DEF_internal_mutrecof('afundef)list(* internal representation of mutually recursive functions *)|DEF_pragmaofstring*string*l(* compiler directive *)