@@ -223,6 +223,17 @@ and fn_defn = {
223223 range : rng
224224}
225225
226+ and slprop_defn = {
227+ id : ident ;
228+ // is_rec:bool;
229+ // us:list ident;
230+ binders : binders ;
231+ // measure:option A.term; // with binders in scope
232+ body : A. term ;
233+ decorations : list A. decoration ;
234+ range : rng
235+ }
236+
226237and let_init =
227238 | Array_initializer of array_init
228239 | Default_initializer of option A. term & list lambda
@@ -367,6 +378,7 @@ instance showable_stmt : showable stmt = {
367378type decl =
368379 | FnDefn of fn_defn
369380 | FnDecl of fn_decl
381+ | SlpropDefn of slprop_defn
370382open FStarC.Class.Deq
371383let eq_ident ( i1 i2 : Ident. ident ) = i1 =? i2
372384let eq_lident ( i1 i2 : Ident. lident ) = i1 =? i2
@@ -395,6 +407,7 @@ let rec eq_decl (d1 d2:decl) =
395407 match d1 , d2 with
396408 | FnDefn f1 , FnDefn f2 -> eq_fn_defn f1 f2
397409 | FnDecl d1 , FnDecl d2 -> eq_fn_decl d1 d2
410+ | SlpropDefn d1 , SlpropDefn d2 -> eq_slprop_defn d1 d2
398411 | _ -> false
399412and eq_fn_decl ( f1 f2 : fn_decl ) =
400413 eq_ident f1 . id f2 . id &&
@@ -409,6 +422,13 @@ and eq_fn_defn (f1 f2:fn_defn) =
409422 eq_ascription f1 . ascription f2 . ascription &&
410423 eq_opt AD. eq_term f1 . measure f2 . measure &&
411424 eq_body f1 . body f2 . body
425+ and eq_slprop_defn ( f1 f2 : slprop_defn ) =
426+ eq_ident f1 . id f2 . id &&
427+ // f1.is_rec = f2.is_rec &&
428+ // forall2 eq_ident f1.us f2.us &&
429+ forall2 AD. eq_binder f1 . binders f2 . binders &&
430+ // eq_opt AD.eq_term f1.measure f2.measure &&
431+ AD. eq_term f1 . body f2 . body
412432and eq_ascription ( a1 a2 : either computation_type ( option A. term )) =
413433 match a1 , a2 with
414434 | Inl c1 , Inl c2 -> eq_computation_type c1 c2
@@ -543,6 +563,7 @@ let rec scan_decl (cbs:A.dep_scan_callbacks) (d:decl) : unit =
543563 match d with
544564 | FnDefn f -> scan_fn_defn cbs f
545565 | FnDecl d -> scan_fn_decl cbs d
566+ | SlpropDefn d -> scan_slprop_defn cbs d
546567and scan_fn_decl ( cbs : A. dep_scan_callbacks ) ( f : fn_decl ) =
547568 iter ( scan_binder cbs ) f . binders ;
548569 scan_ascription cbs f . ascription
@@ -551,6 +572,10 @@ and scan_fn_defn (cbs:A.dep_scan_callbacks) (f:fn_defn) =
551572 ieither ( scan_computation_type cbs ) ( iopt cbs . scan_term ) f . ascription ;
552573 iopt cbs . scan_term f . measure ;
553574 ieither ( scan_stmt cbs ) ( scan_lambda cbs ) f . body
575+ and scan_slprop_defn ( cbs : A. dep_scan_callbacks ) ( f : slprop_defn ) =
576+ iter ( scan_binder cbs ) f . binders ;
577+ // iopt cbs.scan_term f.measure;
578+ cbs . scan_term f . body
554579and scan_binder ( cbs : A. dep_scan_callbacks ) ( b : binder ) =
555580 cbs . scan_binder b
556581and scan_ascription ( cbs : A. dep_scan_callbacks ) ( a : either computation_type ( option A. term )) =
@@ -645,6 +670,7 @@ let range_of_decl (d:decl) =
645670 match d with
646671 | FnDefn f -> f . range
647672 | FnDecl d -> d . range
673+ | SlpropDefn d -> d . range
648674(* Convenience builders for use from OCaml/Menhir, since field names get mangled in OCaml *)
649675let mk_comp tag literally annots range =
650676 {
@@ -657,6 +683,7 @@ let add_decorations d ds =
657683 match d with
658684 | FnDefn f -> FnDefn { f with decorations = ds @ f . decorations }
659685 | FnDecl f -> FnDecl { f with decorations = ds @ f . decorations }
686+ | SlpropDefn f -> SlpropDefn { f with decorations = ds @ f . decorations }
660687
661688// let mk_slprop_exists binders body = SLPropExists { binders; body }
662689let mk_expr e args = Expr { e ; args }
@@ -676,6 +703,9 @@ let mk_fn_defn id is_rec us binders ascription measure body decorations range
676703let mk_fn_decl id us binders ascription decorations range
677704: fn_decl
678705= { id ; us ; binders ; ascription ; decorations ; range }
706+ let mk_slprop_defn id binders body decorations range
707+ : slprop_defn
708+ = { id ; binders ; body ; decorations ; range }
679709let mk_open lid = Open lid
680710let mk_proof_hint_with_binders ht bs = ProofHintWithBinders { hint_type = ht ; binders = bs }
681711let mk_lambda bs ascription body range : lambda = { binders = bs ; ascription ; body ; range }
0 commit comments