12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394openGospelmoduleIdent=Identifier.Identtypeterm={term:Tterm.term;text:string}letterm~prj_txt~prj_locspecterm=lettext=Ortac_core.Utils.term_printer(prj_txtspec)(prj_locspec)termin{term;text}letterm_val=term~prj_txt:(funs->s.Tast.sp_text)~prj_loc:(funs->s.Tast.sp_loc)letterm_type=term~prj_txt:(funs->s.Tast.ty_text)~prj_loc:(funs->s.Tast.ty_loc)typexpost=Ttypes.xsymbol*Tterm.patternoption*termtypenew_state_formulae={model:Ident.t;(* the name of the model's field *)description:Tterm.term;(* the new value for the model's field *)}typeindexed_term=int*term(* XXX TODO decide whether we need checks here (if checks is false, state does
not change) *)typenext_state={(* description of the new values are stored with the index of the
postcondition they come from *)formulae:(int*new_state_formulae)list;modifies:(Ident.t*Ppxlib.Location.t)list;}typepostcond={normal:indexed_termlist;exceptional:xpostlist;checks:termlist;}typevalue={id:Ident.t;ty:Ppxlib.core_type;inst:(string*Ppxlib.core_type)list;sut_vars:Ident.tlist;(* invariant: suts must be in the order in which they appear, so for
example in [test (t1 : sut) (t2 : sut)] the list must be [t1; t2] *)fun_vars:Ident.tlist;args:(Ppxlib.core_type*Ident.toption)list;(* arguments of unit types can be nameless *)ret:Ident.tlist;ret_values:termlistlist;next_states:(Ident.t*next_state)list;(* each used sut can have a different next state *)precond:Tterm.termlist;postcond:postcond;}typeinit_state={arguments:(Tast.lb_arg*Ppxlib.expression)list;returned_sut:Ident.t;descriptions:new_state_formulaelist;}letget_return_typevalue=letopenPpxlibinletrecauxty=matchty.ptyp_descwithPtyp_arrow(_,_,r)->auxr|_->tyinauxvalue.tyletvalueidtyinstsut_varsfun_varsargsretret_valuesnext_statesprecondpostcond={id;ty;inst;sut_vars;fun_vars;args;ret;ret_values;next_states;precond;postcond;}typet={state:(Ident.t*Ppxlib.core_type)list;invariants:(Ident.t*termlist)option;init_state:init_state;ghost_functions:Tast.function_list;ghost_types:(Tast.rec_flag*Tast.type_declarationlist)list;values:valuelist;}