effect
stringclasses 48
values | original_source_type
stringlengths 0
23k
| opens_and_abbrevs
listlengths 2
92
| isa_cross_project_example
bool 1
class | source_definition
stringlengths 9
57.9k
| partial_definition
stringlengths 7
23.3k
| is_div
bool 2
classes | is_type
null | is_proof
bool 2
classes | completed_definiton
stringlengths 1
250k
| dependencies
dict | effect_flags
sequencelengths 0
2
| ideal_premises
sequencelengths 0
236
| mutual_with
sequencelengths 0
11
| file_context
stringlengths 0
407k
| interleaved
bool 1
class | is_simply_typed
bool 2
classes | file_name
stringlengths 5
48
| vconfig
dict | is_simple_lemma
null | source_type
stringlengths 10
23k
| proof_features
sequencelengths 0
1
| name
stringlengths 8
95
| source
dict | verbose_type
stringlengths 1
7.42k
| source_range
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.Tactics.Effect.Tac | val solve_gen_elim_prop: Prims.unit -> T.Tac unit | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.GenElim",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.GenElim",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let solve_gen_elim_prop
()
: T.Tac unit
=
let (hd, tl) = T.collect_app (T.cur_goal ()) in
if not (is_squash hd)
then T.fail "not a squash goal";
match tl with
| [body1, T.Q_Explicit] ->
let (hd1, tl1) = T.collect_app body1 in
if not (hd1 `is_fvar` (`%gen_elim_prop))
then T.fail "not a gen_elim_prop goal";
begin match List.Tot.filter (fun (_, x) -> T.Q_Explicit? x) tl1 with
| [(enable_nondep_opt_tm, _); (p, _); (a, _); (q, _); (post, _)] ->
let enable_nondep_opt = enable_nondep_opt_tm `T.term_eq_old` (`true) in
let i' = solve_gen_elim p in
let norm () = T.norm [delta_attr [(`%gen_elim_reduce)]; zeta; iota] in
begin match solve_gen_elim_nondep0 enable_nondep_opt i' with
| None ->
T.apply_lemma (T.mk_app (`gen_elim_prop_intro') [
i', T.Q_Explicit;
(`GEDep), T.Q_Explicit;
])
| Some (Mktuple5 type_list tvprop q0 tprop post0) ->
T.apply_lemma (T.mk_app (`gen_elim_prop_intro) [
i', T.Q_Explicit;
type_list, T.Q_Explicit;
tvprop, T.Q_Explicit;
q0, T.Q_Explicit;
tprop, T.Q_Explicit;
post0, T.Q_Explicit;
]);
T.focus (fun _ -> norm (); T.trefl ()); // tvprop
T.focus (fun _ -> norm (); T.trefl ()) // tprop
end;
T.focus (fun _ -> norm (); T.trefl ()); // p
T.focus (fun _ -> norm (); T.trivial (); T.qed ()); // j
T.focus (fun _ -> norm (); T.trefl ()); // a
T.focus (fun _ -> norm (); T.trefl ()); // q
T.focus (fun _ -> norm (); T.trefl ()) // post
| _ -> T.fail "ill formed gen_elim_prop"
end
| _ -> T.fail "ill-formed squash" | val solve_gen_elim_prop: Prims.unit -> T.Tac unit
let solve_gen_elim_prop () : T.Tac unit = | true | null | false | let hd, tl = T.collect_app (T.cur_goal ()) in
if not (is_squash hd) then T.fail "not a squash goal";
match tl with
| [body1, T.Q_Explicit] ->
let hd1, tl1 = T.collect_app body1 in
if not (hd1 `is_fvar` (`%gen_elim_prop)) then T.fail "not a gen_elim_prop goal";
(match List.Tot.filter (fun (_, x) -> T.Q_Explicit? x) tl1 with
| [enable_nondep_opt_tm, _ ; p, _ ; a, _ ; q, _ ; post, _] ->
let enable_nondep_opt = enable_nondep_opt_tm `T.term_eq_old` (`true) in
let i' = solve_gen_elim p in
let norm () = T.norm [delta_attr [(`%gen_elim_reduce)]; zeta; iota] in
(match solve_gen_elim_nondep0 enable_nondep_opt i' with
| None ->
T.apply_lemma (T.mk_app (`gen_elim_prop_intro') [i', T.Q_Explicit; (`GEDep), T.Q_Explicit]
)
| Some (Mktuple5 type_list tvprop q0 tprop post0) ->
T.apply_lemma (T.mk_app (`gen_elim_prop_intro)
[
i', T.Q_Explicit;
type_list, T.Q_Explicit;
tvprop, T.Q_Explicit;
q0, T.Q_Explicit;
tprop, T.Q_Explicit;
post0, T.Q_Explicit
]);
T.focus (fun _ ->
norm ();
T.trefl ());
T.focus (fun _ ->
norm ();
T.trefl ()));
T.focus (fun _ ->
norm ();
T.trefl ());
T.focus (fun _ ->
norm ();
T.trivial ();
T.qed ());
T.focus (fun _ ->
norm ();
T.trefl ());
T.focus (fun _ ->
norm ();
T.trefl ());
T.focus (fun _ ->
norm ();
T.trefl ())
| _ -> T.fail "ill formed gen_elim_prop")
| _ -> T.fail "ill-formed squash" | {
"checked_file": "Steel.ST.GenElim.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.Effect.Common.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Reflection.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.GenElim.Base.fsti"
} | [] | [
"Prims.unit",
"FStar.Reflection.Types.term",
"Prims.list",
"FStar.Reflection.V1.Data.argv",
"FStar.List.Tot.Base.filter",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Data.aqualv",
"FStar.Reflection.V1.Data.uu___is_Q_Explicit",
"Prims.bool",
"FStar.Tactics.V1.Derived.focus",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Derived.qed",
"FStar.Tactics.V1.Derived.trivial",
"FStar.Tactics.V1.Derived.apply_lemma",
"FStar.Reflection.V1.Derived.mk_app",
"Prims.Cons",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Reflection.V1.Data.Q_Explicit",
"Prims.Nil",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple5",
"Steel.ST.GenElim.Base.solve_gen_elim_nondep0",
"FStar.Tactics.V1.Builtins.norm",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_attr",
"Prims.string",
"FStar.Pervasives.zeta",
"FStar.Pervasives.iota",
"Steel.ST.GenElim.Base.solve_gen_elim",
"FStar.Tactics.V1.Builtins.term_eq_old",
"FStar.Tactics.V1.Derived.fail",
"Prims.op_Negation",
"Steel.ST.GenElim.Base.is_fvar",
"FStar.Tactics.V1.SyntaxHelpers.collect_app",
"Steel.ST.GenElim.Base.is_squash",
"FStar.Tactics.V1.Derived.cur_goal",
"FStar.Reflection.Types.typ"
] | [] | module Steel.ST.GenElim.Base
include Steel.ST.Util
module T = FStar.Tactics
let is_fvar = Reflection.is_fvar
let is_any_fvar = Reflection.is_any_fvar
/// A tactic to automatically generate a unique binder
[@@erasable]
noeq
type gen_unit_elim_i
= | GUEId: (v: vprop) -> gen_unit_elim_i
| GUEPure: (p: prop) -> gen_unit_elim_i
| GUEStar: (left: gen_unit_elim_i) -> (right: gen_unit_elim_i) -> gen_unit_elim_i
[@@erasable]
noeq
type gen_elim_i =
| GEUnit: (i: gen_unit_elim_i) -> gen_elim_i
| GEStarL: (left: gen_elim_i) -> (right: gen_unit_elim_i) -> gen_elim_i
| GEStarR: (left: gen_unit_elim_i) -> (right: gen_elim_i) -> gen_elim_i
| GEStar: (left: gen_elim_i) -> (right: gen_elim_i) -> gen_elim_i
| GEExistsNoAbs: (#a: Type0) -> (body: (a -> vprop)) -> gen_elim_i // FIXME: generalize the universe
| GEExistsUnit: (#a: Type0) -> (body: (a -> gen_unit_elim_i)) -> gen_elim_i
| GEExists: (#a: Type0) -> (body: (a -> gen_elim_i)) -> gen_elim_i
val gen_elim_reduce: unit
[@@ gen_elim_reduce]
let rec compute_gen_unit_elim_p
(x: gen_unit_elim_i)
: Tot vprop
= match x with
| GUEId v -> v
| GUEPure p -> pure p
| GUEStar left right -> compute_gen_unit_elim_p left `star` compute_gen_unit_elim_p right
[@@ gen_elim_reduce]
let rec compute_gen_unit_elim_q
(x: gen_unit_elim_i)
: Tot vprop
= match x with
| GUEId v -> v
| GUEPure _ -> emp
| GUEStar left right -> compute_gen_unit_elim_q left `star` compute_gen_unit_elim_q right
[@@gen_elim_reduce; noextract_to "Plugin"]
let rec compute_gen_unit_elim_post
(x: gen_unit_elim_i)
: Tot prop
= match x with
| GUEId _ -> True
| GUEPure p -> p
| GUEStar left right -> compute_gen_unit_elim_post left /\ compute_gen_unit_elim_post right
[@@gen_elim_reduce]
let rec compute_gen_elim_p
(x: gen_elim_i)
: Tot vprop
= match x with
| GEUnit i -> compute_gen_unit_elim_p i
| GEStarL left right -> compute_gen_elim_p left `star` compute_gen_unit_elim_p right
| GEStarR left right -> compute_gen_unit_elim_p left `star` compute_gen_elim_p right
| GEStar left right -> compute_gen_elim_p left `star` compute_gen_elim_p right
| GEExistsNoAbs #a p -> exists_ p
| GEExistsUnit #a p -> exists_ (fun x -> compute_gen_unit_elim_p (p x))
| GEExists #a body -> exists_ (fun x -> compute_gen_elim_p (body x))
let compute_gen_elim_p' = compute_gen_elim_p
[@@ gen_elim_reduce; __steel_reduce__; noextract_to "Plugin"]
let rec compute_gen_elim_a
(x: gen_elim_i)
: Tot Type0
= match x with
| GEUnit _ -> unit
| GEStarL left _ -> compute_gen_elim_a left
| GEStarR _ right -> compute_gen_elim_a right
| GEStar left right -> (compute_gen_elim_a left & compute_gen_elim_a right)
| GEExistsNoAbs #a _
| GEExistsUnit #a _ -> a
| GEExists #a body -> dtuple2 a (fun x -> compute_gen_elim_a (body x))
[@@noextract_to "Plugin"]
let dfstp #a #b t = dfst #a #b t
[@@noextract_to "Plugin"]
let dsndp #a #b t = dsnd #a #b t
[@@noextract_to "Plugin"]
let fstp #a #b t = fst #a #b t
[@@noextract_to "Plugin"]
let sndp #a #b t = snd #a #b t
[@@gen_elim_reduce; __steel_reduce__; noextract_to "Plugin"]
let coerce_with_trefl (#tfrom #tto: Type) (x: tfrom) : Pure tto (requires (T.with_tactic T.trefl (tfrom == tto))) (ensures (fun _ -> True)) = x
[@@gen_elim_reduce]
let rec compute_gen_elim_q
(x: gen_elim_i)
: Tot (compute_gen_elim_a x -> Tot vprop)
(decreases x)
= match x as x' returns (compute_gen_elim_a x' -> Tot vprop) with
| GEUnit u -> fun _ -> compute_gen_unit_elim_q u
| GEStarL left right -> fun v -> compute_gen_elim_q left (coerce_with_trefl v) `star` compute_gen_unit_elim_q right
| GEStarR left right -> fun v -> compute_gen_unit_elim_q left `star` compute_gen_elim_q right (coerce_with_trefl v)
| GEStar left right ->
let tleft = compute_gen_elim_a left in
let tright = compute_gen_elim_a right in
fun v ->
let v' : (tleft & tright) = coerce_with_trefl v in
compute_gen_elim_q left (fstp #tleft #tright v') `star` compute_gen_elim_q right (sndp #tleft #tright v')
| GEExistsNoAbs #a p -> p
| GEExistsUnit #a p -> fun v -> compute_gen_unit_elim_q (p v)
| GEExists #a body ->
let dept = (fun x -> compute_gen_elim_a (body x)) in
fun v ->
let v' : dtuple2 a dept = coerce_with_trefl v in
compute_gen_elim_q
(body (dfstp #a #dept v'))
(dsndp #a #dept v')
[@@gen_elim_reduce; noextract_to "Plugin"]
let rec compute_gen_elim_post
(x: gen_elim_i)
: Tot (compute_gen_elim_a x -> Tot prop)
(decreases x)
= match x as x' returns (compute_gen_elim_a x' -> Tot prop) with
| GEUnit u -> fun _ -> compute_gen_unit_elim_post u
| GEStarL left right -> fun v -> compute_gen_elim_post left (coerce_with_trefl v) /\ compute_gen_unit_elim_post right
| GEStarR left right -> fun v -> compute_gen_unit_elim_post left /\ compute_gen_elim_post right (coerce_with_trefl v)
| GEStar left right ->
let tleft = compute_gen_elim_a left in
let tright = compute_gen_elim_a right in
fun v ->
let v' : (tleft & tright) = coerce_with_trefl v in
compute_gen_elim_post left (fstp #tleft #tright v') /\ compute_gen_elim_post right (sndp #tleft #tright v')
| GEExistsNoAbs #a p -> fun _ -> True
| GEExistsUnit #a p -> fun v -> compute_gen_unit_elim_post (p v)
| GEExists #a body ->
let dept = (fun x -> compute_gen_elim_a (body x)) in
fun v ->
let v' : dtuple2 a dept = coerce_with_trefl v in
compute_gen_elim_post
(body (dfstp #a #dept v'))
(dsndp #a #dept v')
[@@erasable]
noeq
type gen_elim_tele =
| TRet: vprop -> prop -> gen_elim_tele
| TExists: (ty: Type u#0) -> (ty -> gen_elim_tele) -> gen_elim_tele
[@@gen_elim_reduce]
let rec tele_star_vprop (i: gen_elim_tele) (v: vprop) (p: prop) : Tot gen_elim_tele (decreases i) =
match i with
| TRet v' p' -> TRet (v `star` v') (p /\ p')
| TExists ty f -> TExists ty (fun x -> tele_star_vprop (f x) v p)
[@@gen_elim_reduce]
let rec tele_star (i1 i2: gen_elim_tele) : Tot gen_elim_tele =
match i1, i2 with
| TRet v1 p1, _ -> tele_star_vprop i2 v1 p1
| _, TRet v2 p2 -> tele_star_vprop i1 v2 p2
| TExists ty1 f1, TExists ty2 f2 -> TExists ty1 (fun x1 -> TExists ty2 (fun x2 -> tele_star (f1 x1) (f2 x2)))
[@@gen_elim_reduce]
let rec compute_gen_elim_tele (x: gen_elim_i) : Tot gen_elim_tele =
match x with
| GEUnit v -> TRet (compute_gen_unit_elim_q v) (compute_gen_unit_elim_post v)
| GEStarL l ru -> tele_star_vprop (compute_gen_elim_tele l) (compute_gen_unit_elim_q ru) (compute_gen_unit_elim_post ru)
| GEStarR lu r -> tele_star_vprop (compute_gen_elim_tele r) (compute_gen_unit_elim_q lu) (compute_gen_unit_elim_post lu)
| GEStar l r -> tele_star (compute_gen_elim_tele l) (compute_gen_elim_tele r)
| GEExistsNoAbs #ty body -> TExists ty (fun x -> TRet (body x) True)
| GEExistsUnit #ty body -> TExists ty (fun x -> TRet (compute_gen_unit_elim_q (body x)) (compute_gen_unit_elim_post (body x)))
| GEExists #ty f -> TExists ty (fun x -> compute_gen_elim_tele (f x))
[@@gen_elim_reduce; noextract_to "Plugin"]
let rec curried_function_type (x: list (Type u#a)) (ret_t: Type u#(max a b)) : Tot (Type u#(max a b)) =
match x with
| [] -> ret_t
| t1 :: q -> t1 -> Tot (curried_function_type q ret_t)
[@@erasable]
noeq
type gen_elim_nondep_t =
| GENonDep: (ty: list Type0) -> curried_function_type ty vprop -> curried_function_type ty prop -> gen_elim_nondep_t
| GEDep
[@@gen_elim_reduce]
let mk_gen_elim_nondep
(ty: list Type0)
(tvprop: Type)
(q: tvprop)
(tprop: Type)
(post: tprop)
: Pure gen_elim_nondep_t
(requires (
tvprop == curried_function_type ty vprop /\
tprop == curried_function_type ty prop
))
(ensures (fun _ -> True))
= GENonDep ty q post
[@@gen_elim_reduce]
let mk_gen_elim_nondep_by_tac
(ty: list Type0)
(tvprop: Type)
(q: tvprop)
(tprop: Type)
(post: tprop)
: Pure gen_elim_nondep_t
(requires (
T.with_tactic (fun _ -> T.norm [delta_attr [(`%gen_elim_reduce)]; iota; zeta]) (tvprop == curried_function_type ty vprop) /\
T.with_tactic (fun _ -> T.norm [delta_attr [(`%gen_elim_reduce)]; iota; zeta]) (tprop == curried_function_type ty prop)
))
(ensures (fun _ -> True))
= GENonDep ty q post
[@@gen_elim_reduce]
let rec gen_elim_nondep_sem (ty: list Type0) : Tot (curried_function_type ty vprop -> curried_function_type ty prop -> Tot gen_elim_tele) =
match ty as ty' returns curried_function_type ty' vprop -> curried_function_type ty' prop -> Tot gen_elim_tele with
| [] -> fun q post -> TRet q post
| t :: tq -> fun q post -> TExists t (fun x -> gen_elim_nondep_sem tq (q x) (post x))
[@@gen_elim_reduce; noextract_to "Plugin"]
let check_gen_elim_nondep_sem (i: gen_elim_i) (nd: gen_elim_nondep_t) : Tot prop =
match nd with
| GENonDep ty q post -> compute_gen_elim_tele i == gen_elim_nondep_sem ty q post
| GEDep -> True
[@@gen_elim_reduce; noextract_to "Plugin"]
let compute_gen_elim_nondep_a' (ty: list Type0) : Tot Type0 =
match ty with
| [] -> unit
| [t1] -> t1
| [t1; t2] -> tuple2 t1 t2
| [t1; t2; t3] -> tuple3 t1 t2 t3
| [t1; t2; t3; t4] -> tuple4 t1 t2 t3 t4
| [t1; t2; t3; t4; t5] -> tuple5 t1 t2 t3 t4 t5
| [t1; t2; t3; t4; t5; t6] -> tuple6 t1 t2 t3 t4 t5 t6
| [t1; t2; t3; t4; t5; t6; t7] -> tuple7 t1 t2 t3 t4 t5 t6 t7
| [t1; t2; t3; t4; t5; t6; t7; t8] -> tuple8 t1 t2 t3 t4 t5 t6 t7 t8
| [t1; t2; t3; t4; t5; t6; t7; t8; t9] -> tuple9 t1 t2 t3 t4 t5 t6 t7 t8 t9
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10] -> tuple10 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11] -> tuple11 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12] -> tuple12 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12; t13] -> tuple13 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12; t13; t14] -> tuple14 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14
| _ -> unit // unsupported
[@@gen_elim_reduce; noextract_to "Plugin"]
let compute_gen_elim_nondep_a (i0: gen_elim_i) (i: gen_elim_nondep_t) : Tot Type0 =
match i with
| GENonDep ty q post -> compute_gen_elim_nondep_a' ty
| GEDep -> compute_gen_elim_a i0
[@@gen_elim_reduce; noextract_to "Plugin"]
let compute_uncurry (ret_type: Type u#a) (def: ret_type) (ty: list Type0) : curried_function_type ty ret_type -> compute_gen_elim_nondep_a' ty -> ret_type =
match ty as ty' returns (curried_function_type ty' ret_type -> compute_gen_elim_nondep_a' ty' -> ret_type) with
| [] -> fun q _ -> q
| [t1] -> fun q -> q
| [t1; t2] -> fun q x -> q (fstp x) (sndp x)
| [t1; t2; t3] -> fun q x -> q x._1 x._2 x._3
| [t1; t2; t3; t4] -> fun q x -> q x._1 x._2 x._3 x._4
| [t1; t2; t3; t4; t5] -> fun q x -> q x._1 x._2 x._3 x._4 x._5
| [t1; t2; t3; t4; t5; t6] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6
| [t1; t2; t3; t4; t5; t6; t7] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7
| [t1; t2; t3; t4; t5; t6; t7; t8] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8
| [t1; t2; t3; t4; t5; t6; t7; t8; t9] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9 x._10
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9 x._10 x._11
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9 x._10 x._11 x._12
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12; t13] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9 x._10 x._11 x._12 x._13
| [t1; t2; t3; t4; t5; t6; t7; t8; t9; t10; t11; t12; t13; t14] -> fun q x -> q x._1 x._2 x._3 x._4 x._5 x._6 x._7 x._8 x._9 x._10 x._11 x._12 x._13 x._14
| _ -> fun _ _ -> def
[@@gen_elim_reduce]
let compute_gen_elim_nondep_q0 (i0: gen_elim_i) (i: gen_elim_nondep_t) : Tot (compute_gen_elim_nondep_a i0 i -> vprop) =
match i with
| GENonDep ty q post -> compute_uncurry vprop (compute_gen_elim_p' i0) ty q
// that default value does not reduce, on purpose, to make the tactic fail if the type list is too long
| GEDep -> compute_gen_elim_q i0
[@@gen_elim_reduce]
let compute_gen_elim_nondep_q (i0: gen_elim_i) (i: gen_elim_nondep_t) (x: Ghost.erased (compute_gen_elim_nondep_a i0 i)) : Tot vprop =
compute_gen_elim_nondep_q0 i0 i (Ghost.reveal x)
[@@gen_elim_reduce; noextract_to "Plugin"]
let compute_gen_elim_nondep_post0 (i0: gen_elim_i) (i: gen_elim_nondep_t) : Tot (compute_gen_elim_nondep_a i0 i -> prop) =
match i with
| GENonDep ty q post -> compute_uncurry prop True ty post
| GEDep -> compute_gen_elim_post i0
[@@gen_elim_reduce; noextract_to "Plugin"]
let compute_gen_elim_nondep_post (i0: gen_elim_i) (i: gen_elim_nondep_t) (x: Ghost.erased (compute_gen_elim_nondep_a i0 i)) : Tot prop =
compute_gen_elim_nondep_post0 i0 i (Ghost.reveal x)
let is_squash (t:T.term) : T.Tac bool =
is_any_fvar t [`%squash; `%auto_squash]
let is_star_or_vstar (t:T.term) : T.Tac bool =
is_any_fvar t [`%star; `%VStar]
let rec term_has_head
(t: T.term)
(head: T.term)
: T.Tac bool
= let (hd, tl) = T.collect_app t in
if hd `T.term_eq_old` head
then true
else if is_star_or_vstar hd
then
match tl with
| [tg, T.Q_Explicit; td, T.Q_Explicit] ->
if term_has_head tg head
then true
else term_has_head td head
| _ -> false
else false
let rec solve_gen_unit_elim
(tl': T.term)
: T.Tac T.term
=
if not (term_has_head tl' (`pure))
then T.mk_app (`GUEId) [tl', T.Q_Explicit]
else
let (hd, tl) = T.collect_app tl' in
if hd `is_fvar` (`%pure)
then T.mk_app (`GUEPure) tl
else if is_star_or_vstar hd
then match tl with
| [t1, T.Q_Explicit; t2, T.Q_Explicit] ->
let t1' = solve_gen_unit_elim t1 in
let t2' = solve_gen_unit_elim t2 in
T.mk_app (`GUEStar) [t1', T.Q_Explicit; t2', T.Q_Explicit]
| _ -> T.fail "ill-formed star"
else
T.mk_app (`GUEId) [tl', T.Q_Explicit]
let abstr_has_exists
(t: T.term)
: T.Tac bool
= match T.inspect t with
| T.Tv_Abs _ body -> term_has_head body (`exists_)
| _ -> false
let rec solve_gen_elim
(tl': T.term)
: T.Tac T.term
=
if not (term_has_head tl' (`exists_))
then begin
let t' = solve_gen_unit_elim tl' in
T.mk_app (`GEUnit) [t', T.Q_Explicit]
end else
let (hd, lbody) = T.collect_app tl' in
if hd `is_fvar` (`%exists_)
then
let (ty, body) =
match lbody with
| [(ty, T.Q_Implicit); (body, T.Q_Explicit)] -> ([(ty, T.Q_Implicit)], body)
| [(body, T.Q_Explicit)] -> ([], body)
| _ -> T.fail "ill-formed exists_"
in
begin match T.inspect body with
| T.Tv_Abs b abody ->
if not (term_has_head abody (`exists_))
then
let body' = solve_gen_unit_elim abody in
T.mk_app (`GEExistsUnit) (ty `List.Tot.append` [T.mk_abs [b] body', T.Q_Explicit])
else
let body' = solve_gen_elim abody in
T.mk_app (`GEExists) (ty `List.Tot.append` [T.mk_abs [b] body', T.Q_Explicit])
| _ ->
T.mk_app (`GEExistsNoAbs) lbody
end
else if is_star_or_vstar hd
then
match lbody with
| [(tl, T.Q_Explicit); (tr, T.Q_Explicit)] ->
if term_has_head tl (`exists_)
then
let tl' = solve_gen_elim tl in
if term_has_head tr (`exists_)
then
let tr' = solve_gen_elim tr in
T.mk_app (`GEStar) [tl', T.Q_Explicit; tr', T.Q_Explicit]
else
let tr' = solve_gen_unit_elim tr in
T.mk_app (`GEStarL) [tl', T.Q_Explicit; tr', T.Q_Explicit]
else (* here, term_has_head tr (`exists_) holds, because otherwise we are in case (not (term_has_head tl (`exists_))) above *)
let tl' = solve_gen_unit_elim tl in
let tr' = solve_gen_elim tr in
T.mk_app (`GEStarR) [tl', T.Q_Explicit; tr', T.Q_Explicit]
| _ -> T.fail "ill-formed star"
else
T.mk_app (`GEUnit) [T.mk_app (`GUEId) lbody, T.Q_Explicit]
[@@ noextract_to "Plugin"]
val gen_elim_prop
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
: Tot prop
val gen_elim_prop_intro'
(i: gen_elim_i)
(j: gen_elim_nondep_t)
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
(sq_p: squash (p == compute_gen_elim_p i))
(sq_j: squash (check_gen_elim_nondep_sem i j))
(sq_a: squash (a == compute_gen_elim_nondep_a i j))
(sq_q: squash (q == compute_gen_elim_nondep_q i j))
(sq_post: squash (post == compute_gen_elim_nondep_post i j))
: Lemma
(gen_elim_prop enable_nondep_opt p a q post)
let gen_elim_prop_intro
(i: gen_elim_i)
(ty: list Type0)
(tvprop: Type)
(q0: tvprop)
(tprop: Type)
(post0: tprop)
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
(sq_tvprop: squash (tvprop == curried_function_type ty vprop))
(sq_tprop: squash (tprop == curried_function_type ty prop))
(sq_p: squash (p == compute_gen_elim_p i))
(sq_j: squash (check_gen_elim_nondep_sem i (mk_gen_elim_nondep ty tvprop q0 tprop post0)))
(sq_a: squash (a == compute_gen_elim_nondep_a i (mk_gen_elim_nondep ty tvprop q0 tprop post0)))
(sq_q: squash (q == compute_gen_elim_nondep_q i (mk_gen_elim_nondep ty tvprop q0 tprop post0)))
(sq_post: squash (post == compute_gen_elim_nondep_post i (mk_gen_elim_nondep ty tvprop q0 tprop post0)))
: Lemma
(gen_elim_prop enable_nondep_opt p a q post)
= gen_elim_prop_intro' i (mk_gen_elim_nondep ty tvprop q0 tprop post0) enable_nondep_opt p a q post sq_p sq_j sq_a sq_q sq_post
val gen_elim_prop_elim
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
: Ghost (gen_elim_i & gen_elim_nondep_t)
(requires gen_elim_prop enable_nondep_opt p a q post)
(ensures (fun (i, j) ->
p == compute_gen_elim_p i /\
check_gen_elim_nondep_sem i j /\
a == compute_gen_elim_nondep_a i j /\
q == compute_gen_elim_nondep_q i j /\
post == compute_gen_elim_nondep_post i j
))
[@@noextract_to "Plugin"]
let gen_elim_prop_placeholder
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
: Tot prop
= True
let gen_elim_prop_placeholder_intro
(enable_nondep_opt: bool)
(p: vprop)
(a: Type0)
(q: Ghost.erased a -> Tot vprop)
(post: Ghost.erased a -> Tot prop)
: Lemma (gen_elim_prop_placeholder enable_nondep_opt p a q post)
= ()
let rec solve_gen_elim_nondep' (fuel: nat) (rev_types_and_binders: list (T.term & T.binder)) (t: T.term) : T.Tac (option (tuple5 T.term T.term T.term T.term T.term)) =
if fuel = 0
then None
else
let (hd, tl) = T.collect_app t in
if hd `is_fvar` (`%TRet)
then match tl with
| [(v, T.Q_Explicit); (p, T.Q_Explicit)] ->
let cons_type (accu: (unit -> T.Tac T.term)) (tb: (T.term & T.binder)) () : T.Tac T.term =
let (ty, _) = tb in
let tl = accu () in
T.mk_app (`Cons) [(`Type0), T.Q_Implicit; ty, T.Q_Explicit; tl, T.Q_Explicit]
in
let nil_type () : T.Tac T.term = T.mk_app (`Nil) [(`Type0), T.Q_Implicit] in
let type_list = List.Tot.fold_left cons_type nil_type rev_types_and_binders () in
let type_list_typechecks =
let open T in
try
let env = cur_env () in
let ty = tc env type_list in
ty `term_eq_old` (`(list Type0))
with _ -> false
in
if not type_list_typechecks
then None
else
let binders = List.Tot.map snd (List.Tot.rev rev_types_and_binders) in
let norm_term = T.norm_term [delta_attr [(`%gen_elim_reduce)]; zeta; iota] in
let v' = T.mk_abs binders v in
let tv' = norm_term (T.mk_app (`curried_function_type) [type_list, T.Q_Explicit; (`vprop), T.Q_Explicit]) in
let p' = T.mk_abs binders p in
let tp' = norm_term (T.mk_app (`curried_function_type) [type_list, T.Q_Explicit; (`prop), T.Q_Explicit]) in
Some (Mktuple5
type_list
tv'
v'
tp'
p'
)
| _ -> None
else if hd `is_fvar` (`%TExists)
then match tl with
| [(ty, _); (f, T.Q_Explicit)] ->
begin match T.inspect f with
| T.Tv_Abs bv body -> solve_gen_elim_nondep' (fuel - 1) ((ty, bv) :: rev_types_and_binders) body
| _ -> None
end
| _ -> None
else None
let solve_gen_elim_nondep0 (enable_nondep_opt: bool) (t: T.term) : T.Tac (option (tuple5 T.term T.term T.term T.term T.term)) =
if enable_nondep_opt
then
let open T in
try
let tele = mk_app (`compute_gen_elim_tele) [t, Q_Explicit] in
let t' = norm_term [delta_attr [(`%gen_elim_reduce)]; zeta; iota] tele in
solve_gen_elim_nondep' 15 [] t' // fuel necessary because F* standard tuple types only go from 0 up to 14 elts
with _ -> None
else None
let solve_gen_elim_nondep (enable_nondep_opt: bool) (t: T.term) : T.Tac T.term =
match solve_gen_elim_nondep0 enable_nondep_opt t with
| None -> (`GEDep)
| Some (Mktuple5
type_list
tv'
v'
tp'
p'
) -> T.mk_app (`mk_gen_elim_nondep_by_tac) [
type_list, T.Q_Explicit;
tv', T.Q_Explicit;
v', T.Q_Explicit;
tp', T.Q_Explicit;
p', T.Q_Explicit;
]
let solve_gen_elim_prop
() | false | false | Steel.ST.GenElim.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val solve_gen_elim_prop: Prims.unit -> T.Tac unit | [] | Steel.ST.GenElim.Base.solve_gen_elim_prop | {
"file_name": "lib/steel/Steel.ST.GenElim.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | {
"end_col": 35,
"end_line": 604,
"start_col": 1,
"start_line": 565
} |
FStar.Pervasives.Lemma | val assertby (p: prop) (pf: (unit -> Lemma p)) : Lemma p | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let assertby (p:prop) (pf : unit -> Lemma p) : Lemma p =
pf () | val assertby (p: prop) (pf: (unit -> Lemma p)) : Lemma p
let assertby (p: prop) (pf: (unit -> Lemma p)) : Lemma p = | false | null | true | pf () | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.prop",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1)
let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs))
[SMTPat (map_dec top xs f)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_dec_len top f xs
let rec __lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}-> 'b)) (xs : list 'a{xs << top}) (ys : list 'b) (i:nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f)
(ensures f (xs `L.index` i) == ys `L.index` i)
= match xs, ys, i with
| _, _, 0 -> ()
| x::xs, y::ys, _ ->
__lemma_map_dec_index top f xs ys (i-1)
let lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == map_dec top xs f `L.index` i)
= Classical.forall_intro (Classical.move_requires (__lemma_map_dec_index top f xs (map_dec top xs f)))
let lemma_map_dec_index_i (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top}) (i : nat {i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == map_dec top xs f `L.index` i)
= lemma_map_dec_index top f xs | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val assertby (p: prop) (pf: (unit -> Lemma p)) : Lemma p | [] | Pulse.Common.assertby | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Prims.prop -> pf: (_: Prims.unit -> FStar.Pervasives.Lemma (ensures p))
-> FStar.Pervasives.Lemma (ensures p) | {
"end_col": 7,
"end_line": 133,
"start_col": 2,
"start_line": 133
} |
Prims.Tot | val op_let_Question (f: option 'a) (g: ('a -> option 'b)) : option 'b | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x | val op_let_Question (f: option 'a) (g: ('a -> option 'b)) : option 'b
let op_let_Question (f: option 'a) (g: ('a -> option 'b)) : option 'b = | false | null | false | match f with
| None -> None
| Some x -> g x | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.None"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_let_Question (f: option 'a) (g: ('a -> option 'b)) : option 'b | [] | Pulse.Common.op_let_Question | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | f: FStar.Pervasives.Native.option 'a -> g: (_: 'a -> FStar.Pervasives.Native.option 'b)
-> FStar.Pervasives.Native.option 'b | {
"end_col": 17,
"end_line": 9,
"start_col": 2,
"start_line": 7
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys) | let rec map_opt f l = | false | null | false | match l with
| [] -> Some []
| x :: xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y :: ys) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"FStar.Pervasives.Native.option",
"Prims.list",
"FStar.Pervasives.Native.Some",
"Prims.Nil",
"Pulse.Common.op_let_Question",
"Pulse.Common.map_opt",
"Prims.Cons"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> [] | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val map_opt : f: (_: _ -> FStar.Pervasives.Native.option _) -> l: Prims.list _
-> FStar.Pervasives.Native.option (Prims.list _) | [
"recursion"
] | Pulse.Common.map_opt | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | f: (_: _ -> FStar.Pervasives.Native.option _) -> l: Prims.list _
-> FStar.Pervasives.Native.option (Prims.list _) | {
"end_col": 16,
"end_line": 52,
"start_col": 22,
"start_line": 47
} |
|
Prims.Tot | val map_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> 'c)) : list 'c | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f | val map_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> 'c)) : list 'c
let rec map_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> 'c)) : list 'c = | false | null | false | match l with
| [] -> []
| x :: xs -> f x :: map_dec top xs f | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"Prims.list",
"Prims.precedes",
"Prims.Nil",
"Prims.Cons",
"Pulse.Common.map_dec"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val map_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> 'c)) : list 'c | [
"recursion"
] | Pulse.Common.map_dec | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: 'a -> l: Prims.list 'b {l << top} -> f: (x: 'b{x << l} -> 'c) -> Prims.list 'c | {
"end_col": 36,
"end_line": 31,
"start_col": 2,
"start_line": 29
} |
Prims.Tot | val for_all_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> bool)) : bool | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f | val for_all_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> bool)) : bool
let rec for_all_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> bool)) : bool = | false | null | false | match l with
| [] -> true
| x :: xs -> f x && for_all_dec top xs f | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"Prims.list",
"Prims.precedes",
"Prims.bool",
"Prims.op_AmpAmp",
"Pulse.Common.for_all_dec"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = () | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val for_all_dec (top: 'a) (l: list 'b {l << top}) (f: (x: 'b{x << l} -> bool)) : bool | [
"recursion"
] | Pulse.Common.for_all_dec | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: 'a -> l: Prims.list 'b {l << top} -> f: (x: 'b{x << l} -> Prims.bool) -> Prims.bool | {
"end_col": 40,
"end_line": 26,
"start_col": 2,
"start_line": 24
} |
Prims.Tot | val map_opt_dec (#a #b #z: _) (top: z) (f: (x: a{x << top} -> option b)) (l: list a {l << top})
: option (list b) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys) | val map_opt_dec (#a #b #z: _) (top: z) (f: (x: a{x << top} -> option b)) (l: list a {l << top})
: option (list b)
let rec map_opt_dec #a #b #z (top: z) (f: (x: a{x << top} -> option b)) (l: list a {l << top})
: option (list b) = | false | null | false | match l with
| [] -> Some []
| x :: xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y :: ys) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"Prims.precedes",
"FStar.Pervasives.Native.option",
"Prims.list",
"FStar.Pervasives.Native.Some",
"Prims.Nil",
"Pulse.Common.op_let_Question",
"Pulse.Common.map_opt_dec",
"Prims.Cons"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val map_opt_dec (#a #b #z: _) (top: z) (f: (x: a{x << top} -> option b)) (l: list a {l << top})
: option (list b) | [
"recursion"
] | Pulse.Common.map_opt_dec | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: z -> f: (x: a{x << top} -> FStar.Pervasives.Native.option b) -> l: Prims.list a {l << top}
-> FStar.Pervasives.Native.option (Prims.list b) | {
"end_col": 16,
"end_line": 60,
"start_col": 2,
"start_line": 55
} |
Prims.Tot | val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)}) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> [] | val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = | false | null | false | match l1, l2 with
| x :: xs, y :: ys -> (x, y) :: (zip xs ys)
| _ -> [] | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Cons",
"FStar.Pervasives.Native.tuple2",
"Pulse.Common.zip",
"Prims.Nil",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.min"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b -> | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)}) | [
"recursion"
] | Pulse.Common.zip | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | l1: Prims.list a -> l2: Prims.list b
-> l:
Prims.list (a * b)
{ FStar.List.Tot.Base.length l ==
Prims.min (FStar.List.Tot.Base.length l1) (FStar.List.Tot.Base.length l2) } | {
"end_col": 13,
"end_line": 45,
"start_col": 26,
"start_line": 43
} |
Prims.Tot | val concat_map_opt (#a #b: _) (f: (a -> option (list b))) (l: list a) : option (list b) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys) | val concat_map_opt (#a #b: _) (f: (a -> option (list b))) (l: list a) : option (list b)
let rec concat_map_opt #a #b (f: (a -> option (list b))) (l: list a) : option (list b) = | false | null | false | match l with
| [] -> Some []
| x :: xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y @ ys) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"total"
] | [
"FStar.Pervasives.Native.option",
"Prims.list",
"FStar.Pervasives.Native.Some",
"Prims.Nil",
"Pulse.Common.op_let_Question",
"Pulse.Common.concat_map_opt",
"FStar.List.Tot.Base.append"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val concat_map_opt (#a #b: _) (f: (a -> option (list b))) (l: list a) : option (list b) | [
"recursion"
] | Pulse.Common.concat_map_opt | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | f: (_: a -> FStar.Pervasives.Native.option (Prims.list b)) -> l: Prims.list a
-> FStar.Pervasives.Native.option (Prims.list b) | {
"end_col": 15,
"end_line": 68,
"start_col": 2,
"start_line": 63
} |
FStar.Pervasives.Lemma | val dec_index (#a: _) (top: 'z) (l: list a {l << top}) (i: nat{i < L.length l})
: Lemma (l `L.index` i << top) [SMTPat (l `L.index` i << top)] | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1) | val dec_index (#a: _) (top: 'z) (l: list a {l << top}) (i: nat{i < L.length l})
: Lemma (l `L.index` i << top) [SMTPat (l `L.index` i << top)]
let rec dec_index #a (top: 'z) (l: list a {l << top}) (i: nat{i < L.length l})
: Lemma (l `L.index` i << top) [SMTPat (l `L.index` i << top)] = | false | null | true | match l, i with
| _, 0 -> ()
| _ :: l, _ -> dec_index top l (i - 1) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.list",
"Prims.precedes",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.List.Tot.Base.length",
"FStar.Pervasives.Native.Mktuple2",
"Prims.int",
"Pulse.Common.dec_index",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"FStar.List.Tot.Base.index",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val dec_index (#a: _) (top: 'z) (l: list a {l << top}) (i: nat{i < L.length l})
: Lemma (l `L.index` i << top) [SMTPat (l `L.index` i << top)] | [
"recursion"
] | Pulse.Common.dec_index | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: 'z -> l: Prims.list a {l << top} -> i: Prims.nat{i < FStar.List.Tot.Base.length l}
-> FStar.Pervasives.Lemma (ensures FStar.List.Tot.Base.index l i << top)
[SMTPat (FStar.List.Tot.Base.index l i << top)] | {
"end_col": 36,
"end_line": 97,
"start_col": 2,
"start_line": 95
} |
FStar.Tactics.Effect.Tac | val zipWith (f: ('a -> 'b -> Tac 'c)) (l: list 'a) (m: list 'b)
: Tac (l': (list 'c){L.length l' == min (L.length l) (L.length m)}) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch" | val zipWith (f: ('a -> 'b -> Tac 'c)) (l: list 'a) (m: list 'b)
: Tac (l': (list 'c){L.length l' == min (L.length l) (L.length m)})
let rec zipWith (f: ('a -> 'b -> Tac 'c)) (l: list 'a) (m: list 'b)
: Tac (l': (list 'c){L.length l' == min (L.length l) (L.length m)}) = | true | null | false | match l, m with
| [], [] -> []
| x :: xs, y :: ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch" | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.min",
"Prims.Cons",
"Pulse.Common.zipWith",
"FStar.Pervasives.Native.tuple2",
"FStar.Tactics.V1.Derived.fail"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)}) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val zipWith (f: ('a -> 'b -> Tac 'c)) (l: list 'a) (m: list 'b)
: Tac (l': (list 'c){L.length l' == min (L.length l) (L.length m)}) | [
"recursion"
] | Pulse.Common.zipWith | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | f: (_: 'a -> _: 'b -> FStar.Tactics.Effect.Tac 'c) -> l: Prims.list 'a -> m: Prims.list 'b
-> FStar.Tactics.Effect.Tac
(l':
Prims.list 'c
{ FStar.List.Tot.Base.length l' ==
Prims.min (FStar.List.Tot.Base.length l) (FStar.List.Tot.Base.length m) }) | {
"end_col": 40,
"end_line": 39,
"start_col": 2,
"start_line": 36
} |
FStar.Pervasives.Lemma | val lemma_map_dec_index_i
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(i: nat{i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == (map_dec top xs f) `L.index` i) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_map_dec_index_i (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top}) (i : nat {i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == map_dec top xs f `L.index` i)
= lemma_map_dec_index top f xs | val lemma_map_dec_index_i
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(i: nat{i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == (map_dec top xs f) `L.index` i)
let lemma_map_dec_index_i
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(i: nat{i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == (map_dec top xs f) `L.index` i) = | false | null | true | lemma_map_dec_index top f xs | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.precedes",
"Prims.list",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.List.Tot.Base.length",
"Pulse.Common.lemma_map_dec_index",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.List.Tot.Base.index",
"Pulse.Common.map_dec",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1)
let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs))
[SMTPat (map_dec top xs f)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_dec_len top f xs
let rec __lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}-> 'b)) (xs : list 'a{xs << top}) (ys : list 'b) (i:nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f)
(ensures f (xs `L.index` i) == ys `L.index` i)
= match xs, ys, i with
| _, _, 0 -> ()
| x::xs, y::ys, _ ->
__lemma_map_dec_index top f xs ys (i-1)
let lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == map_dec top xs f `L.index` i)
= Classical.forall_intro (Classical.move_requires (__lemma_map_dec_index top f xs (map_dec top xs f)))
let lemma_map_dec_index_i (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top}) (i : nat {i < L.length xs}) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_map_dec_index_i
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(i: nat{i < L.length xs})
: Lemma (ensures f (xs `L.index` i) == (map_dec top xs f) `L.index` i) | [] | Pulse.Common.lemma_map_dec_index_i | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
top: 'z ->
f: (x: 'a{x << top} -> 'b) ->
xs: Prims.list 'a {xs << top} ->
i: Prims.nat{i < FStar.List.Tot.Base.length xs}
-> FStar.Pervasives.Lemma
(ensures
f (FStar.List.Tot.Base.index xs i) ==
FStar.List.Tot.Base.index (Pulse.Common.map_dec top xs f) i) | {
"end_col": 32,
"end_line": 130,
"start_col": 4,
"start_line": 130
} |
FStar.Pervasives.Lemma | val lemma_map_dec_index (top: 'z) (f: (x: 'a{x << top} -> 'b)) (xs: list 'a {xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == (map_dec top xs f) `L.index` i) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == map_dec top xs f `L.index` i)
= Classical.forall_intro (Classical.move_requires (__lemma_map_dec_index top f xs (map_dec top xs f))) | val lemma_map_dec_index (top: 'z) (f: (x: 'a{x << top} -> 'b)) (xs: list 'a {xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == (map_dec top xs f) `L.index` i)
let lemma_map_dec_index (top: 'z) (f: (x: 'a{x << top} -> 'b)) (xs: list 'a {xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == (map_dec top xs f) `L.index` i) = | false | null | true | Classical.forall_intro (Classical.move_requires (__lemma_map_dec_index top f xs (map_dec top xs f))) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.precedes",
"Prims.list",
"FStar.Classical.forall_intro",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.List.Tot.Base.length",
"Prims.l_imp",
"Prims.eq2",
"Pulse.Common.map_dec",
"FStar.List.Tot.Base.index",
"FStar.Classical.move_requires",
"Pulse.Common.__lemma_map_dec_index",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.l_Forall",
"Prims.l_and",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1)
let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs))
[SMTPat (map_dec top xs f)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_dec_len top f xs
let rec __lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}-> 'b)) (xs : list 'a{xs << top}) (ys : list 'b) (i:nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f)
(ensures f (xs `L.index` i) == ys `L.index` i)
= match xs, ys, i with
| _, _, 0 -> ()
| x::xs, y::ys, _ ->
__lemma_map_dec_index top f xs ys (i-1)
let lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}) -> 'b) (xs : list 'a{xs << top}) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_map_dec_index (top: 'z) (f: (x: 'a{x << top} -> 'b)) (xs: list 'a {xs << top})
: Lemma (ensures forall i. f (xs `L.index` i) == (map_dec top xs f) `L.index` i) | [] | Pulse.Common.lemma_map_dec_index | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: 'z -> f: (x: 'a{x << top} -> 'b) -> xs: Prims.list 'a {xs << top}
-> FStar.Pervasives.Lemma
(ensures
forall (i:
Prims.nat
{ i < FStar.List.Tot.Base.length xs /\
i < FStar.List.Tot.Base.length (Pulse.Common.map_dec top xs f) }).
f (FStar.List.Tot.Base.index xs i) ==
FStar.List.Tot.Base.index (Pulse.Common.map_dec top xs f) i) | {
"end_col": 104,
"end_line": 126,
"start_col": 4,
"start_line": 126
} |
FStar.Pervasives.Lemma | val lemma_map_dec_len (#a #b #z: _) (top: z) (f: (x: a{x << top} -> b)) (xs: list a {xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs)) [SMTPat (map_dec top xs f)] | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs))
[SMTPat (map_dec top xs f)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_dec_len top f xs | val lemma_map_dec_len (#a #b #z: _) (top: z) (f: (x: a{x << top} -> b)) (xs: list a {xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs)) [SMTPat (map_dec top xs f)]
let rec lemma_map_dec_len #a #b #z (top: z) (f: (x: a{x << top} -> b)) (xs: list a {xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs)) [SMTPat (map_dec top xs f)] = | false | null | true | match xs with
| [] -> ()
| x :: xs -> lemma_map_dec_len top f xs | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.precedes",
"Prims.list",
"Pulse.Common.lemma_map_dec_len",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"Prims.nat",
"FStar.List.Tot.Base.length",
"Pulse.Common.map_dec",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1)
let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs)) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_map_dec_len (#a #b #z: _) (top: z) (f: (x: a{x << top} -> b)) (xs: list a {xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs)) [SMTPat (map_dec top xs f)] | [
"recursion"
] | Pulse.Common.lemma_map_dec_len | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: z -> f: (x: a{x << top} -> b) -> xs: Prims.list a {xs << top}
-> FStar.Pervasives.Lemma
(ensures
FStar.List.Tot.Base.length (Pulse.Common.map_dec top xs f) == FStar.List.Tot.Base.length xs)
[SMTPat (Pulse.Common.map_dec top xs f)] | {
"end_col": 41,
"end_line": 114,
"start_col": 4,
"start_line": 112
} |
FStar.Pervasives.Lemma | val lemma_map_opt_dec_len
(#a #b #z: _)
(top: z)
(f: (x: a{x << top} -> option b))
(xs: list a {xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)] | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs | val lemma_map_opt_dec_len
(#a #b #z: _)
(top: z)
(f: (x: a{x << top} -> option b))
(xs: list a {xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
let rec lemma_map_opt_dec_len
#a
#b
#z
(top: z)
(f: (x: a{x << top} -> option b))
(xs: list a {xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)] = | false | null | true | match xs with
| [] -> ()
| x :: xs -> lemma_map_opt_dec_len top f xs | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.precedes",
"FStar.Pervasives.Native.option",
"Prims.list",
"Pulse.Common.lemma_map_opt_dec_len",
"Prims.unit",
"Prims.b2t",
"FStar.Pervasives.Native.uu___is_Some",
"Pulse.Common.map_opt_dec",
"Prims.squash",
"Prims.eq2",
"Prims.nat",
"FStar.List.Tot.Base.length",
"FStar.Pervasives.Native.__proj__Some__item__v",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs)) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_map_opt_dec_len
(#a #b #z: _)
(top: z)
(f: (x: a{x << top} -> option b))
(xs: list a {xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)] | [
"recursion"
] | Pulse.Common.lemma_map_opt_dec_len | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | top: z -> f: (x: a{x << top} -> FStar.Pervasives.Native.option b) -> xs: Prims.list a {xs << top}
-> FStar.Pervasives.Lemma (requires Some? (Pulse.Common.map_opt_dec top f xs))
(ensures
FStar.List.Tot.Base.length (Some?.v (Pulse.Common.map_opt_dec top f xs)) ==
FStar.List.Tot.Base.length xs)
[SMTPat (Pulse.Common.map_opt_dec top f xs)] | {
"end_col": 45,
"end_line": 76,
"start_col": 4,
"start_line": 74
} |
FStar.Pervasives.Lemma | val __lemma_map_dec_index
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(ys: list 'b)
(i: nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f) (ensures f (xs `L.index` i) == ys `L.index` i) | [
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec __lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}-> 'b)) (xs : list 'a{xs << top}) (ys : list 'b) (i:nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f)
(ensures f (xs `L.index` i) == ys `L.index` i)
= match xs, ys, i with
| _, _, 0 -> ()
| x::xs, y::ys, _ ->
__lemma_map_dec_index top f xs ys (i-1) | val __lemma_map_dec_index
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(ys: list 'b)
(i: nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f) (ensures f (xs `L.index` i) == ys `L.index` i)
let rec __lemma_map_dec_index
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(ys: list 'b)
(i: nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f) (ensures f (xs `L.index` i) == ys `L.index` i) = | false | null | true | match xs, ys, i with
| _, _, 0 -> ()
| x :: xs, y :: ys, _ -> __lemma_map_dec_index top f xs ys (i - 1) | {
"checked_file": "Pulse.Common.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Pulse.Common.fst"
} | [
"lemma"
] | [
"Prims.precedes",
"Prims.list",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.List.Tot.Base.length",
"FStar.Pervasives.Native.Mktuple3",
"Prims.int",
"Pulse.Common.__lemma_map_dec_index",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.eq2",
"Pulse.Common.map_dec",
"Prims.squash",
"FStar.List.Tot.Base.index",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Pulse.Common
module L = FStar.List.Tot
open FStar.Tactics
let (let?) (f:option 'a) (g:'a -> option 'b) : option 'b =
match f with
| None -> None
| Some x -> g x
// let lem_bind_opt_some (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires Some? ((let?) x f))
// (ensures Some? x /\ Some? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
// let lem_bind_opt_none (x : option 'a) (f : 'a -> option 'b)
// : Lemma (requires None? ((let?) x f))
// (ensures None? x \/ None? (f (Some?.v x)))
// [SMTPat (Some? ((let?) x f))]
// = ()
let rec for_all_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> bool)) : bool =
match l with
| [] -> true
| x::xs -> f x && for_all_dec top xs f
let rec map_dec (top:'a) (l : list 'b{l << top}) (f : (x:'b{x << l} -> 'c)) : list 'c =
match l with
| [] -> []
| x::xs -> f x :: map_dec top xs f
let rec zipWith (f : 'a -> 'b -> Tac 'c) (l : list 'a) (m : list 'b)
: Tac (l':(list 'c){L.length l' == min (L.length l) (L.length m)})
=
match l, m with
| [], [] -> []
| x::xs, y::ys -> f x y :: zipWith f xs ys
| _ -> fail "zipWith: length mismatch"
val zip : (#a:Type) -> (#b:Type) -> l1:list a -> l2:list b ->
Tot (l:list (a * b){L.length l == min (L.length l1) (L.length l2)})
let rec zip #a #b l1 l2 = match l1, l2 with
| x::xs, y::ys -> (x,y) :: (zip xs ys)
| _ -> []
let rec map_opt f l = match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt f xs in
Some (y::ys)
let rec map_opt_dec #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (l : list a{l << top}) : option (list b)
= match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = map_opt_dec top f xs in
Some (y::ys)
let rec concat_map_opt #a #b (f : a -> option (list b)) (l : list a) : option (list b) =
match l with
| [] -> Some []
| x::xs ->
let? y = f x in
let? ys = concat_map_opt f xs in
Some (y@ys)
let rec lemma_map_opt_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> option b) (xs : list a{xs << top})
: Lemma (requires (Some? (map_opt_dec top f xs)))
(ensures (L.length (Some?.v (map_opt_dec top f xs)) == L.length xs))
[SMTPat (map_opt_dec top f xs)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_opt_dec_len top f xs
// let rec __lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b) (i:nat{i < L.length xs})
// : Lemma (requires map_opt f xs == Some ys)
// (ensures f (xs `L.index` i) == Some (ys `L.index` i))
// = match xs, ys, i with
// | _, _, 0 -> ()
// | x::xs, y::ys, _ ->
// __lemma_map_opt_index f xs ys (i-1)
// let lemma_map_opt_index (f : 'a -> option 'b) (xs : list 'a) (ys : list 'b)
// : Lemma (requires map_opt f xs == Some ys)
// (ensures forall i. f (xs `L.index` i) == Some (ys `L.index` i))
// = Classical.forall_intro (Classical.move_requires (__lemma_map_opt_index f xs ys))
let rec dec_index #a (top:'z) (l : list a{l << top}) (i : nat{i < L.length l})
: Lemma (l `L.index` i << top)
[SMTPat (l `L.index` i << top)]
= match l, i with
| _, 0 -> ()
| _::l, _ -> dec_index top l (i-1)
let rec lemma_map_dec_len #a #b #z (top:z) (f : (x:a{x << top}) -> b) (xs : list a{xs << top})
: Lemma (ensures (L.length (map_dec top xs f) == L.length xs))
[SMTPat (map_dec top xs f)]
= match xs with
| [] -> ()
| x::xs -> lemma_map_dec_len top f xs
let rec __lemma_map_dec_index (top:'z) (f : (x:'a{x<<top}-> 'b)) (xs : list 'a{xs << top}) (ys : list 'b) (i:nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f) | false | false | Pulse.Common.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val __lemma_map_dec_index
(top: 'z)
(f: (x: 'a{x << top} -> 'b))
(xs: list 'a {xs << top})
(ys: list 'b)
(i: nat{i < L.length xs})
: Lemma (requires ys == map_dec top xs f) (ensures f (xs `L.index` i) == ys `L.index` i) | [
"recursion"
] | Pulse.Common.__lemma_map_dec_index | {
"file_name": "lib/steel/pulse/Pulse.Common.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
top: 'z ->
f: (x: 'a{x << top} -> 'b) ->
xs: Prims.list 'a {xs << top} ->
ys: Prims.list 'b ->
i: Prims.nat{i < FStar.List.Tot.Base.length xs}
-> FStar.Pervasives.Lemma (requires ys == Pulse.Common.map_dec top xs f)
(ensures f (FStar.List.Tot.Base.index xs i) == FStar.List.Tot.Base.index ys i) | {
"end_col": 44,
"end_line": 122,
"start_col": 4,
"start_line": 119
} |
Prims.Tot | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (()))) | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\
va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\
(forall (va_x_efl: Vale.X64.Flags.t) (va_x_xmm1: quad32) (va_x_xmm2: quad32).
let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in
va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.CPU_Features_s.avx_enabled",
"Vale.X64.CPU_Features_s.sse_enabled",
"Prims.op_LessThan",
"Vale.Math.Poly2_s.degree",
"Prims.eq2",
"Vale.Def.Types_s.quad32",
"Vale.X64.Decls.va_get_xmm",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Prims.l_Forall",
"Vale.X64.Flags.t",
"Vale.X64.Decls.quad32",
"Prims.l_imp",
"Vale.Math.Poly2_s.shift",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_xmm",
"Vale.X64.Decls.va_upd_flags"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr] | false | true | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.X64.GF128_Mul.va_wp_ShiftLeft128_1 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Vale.Math.Poly2_s.poly ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 88,
"end_line": 42,
"start_col": 2,
"start_line": 38
} |
Prims.Tot | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree
a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==> va_k va_sM (()))) | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\
Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_xmm 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_efl: Vale.X64.Flags.t)
(va_x_r12: nat64)
(va_x_xmm1: quad32)
(va_x_xmm2: quad32)
(va_x_xmm3: quad32)
(va_x_xmm4: quad32)
(va_x_xmm5: quad32)
(va_x_xmm6: quad32).
let va_sM =
va_upd_xmm 6
va_x_xmm6
(va_upd_xmm 5
va_x_xmm5
(va_upd_xmm 4
va_x_xmm4
(va_upd_xmm 3
va_x_xmm3
(va_upd_xmm 2
va_x_xmm2
(va_upd_xmm 1
va_x_xmm1
(va_upd_reg64 rR12 va_x_r12 (va_upd_flags va_x_efl va_s0)))))))
in
va_get_ok va_sM /\
va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.CPU_Features_s.pclmulqdq_enabled",
"Vale.X64.CPU_Features_s.avx_enabled",
"Vale.X64.CPU_Features_s.sse_enabled",
"Prims.op_LessThanOrEqual",
"Vale.Math.Poly2_s.degree",
"Prims.eq2",
"Vale.Def.Types_s.quad32",
"Vale.X64.Decls.va_get_xmm",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Vale.Math.Poly2_s.reverse",
"Prims.l_Forall",
"Vale.X64.Flags.t",
"Vale.X64.Machine_s.nat64",
"Vale.X64.Decls.quad32",
"Prims.l_imp",
"Vale.AES.GF128_s.gf128_mul",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_xmm",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR12",
"Vale.X64.Decls.va_upd_flags"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2;
va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a) (va_wpProof_ShiftLeft128_1 a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
(pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree a <= 127 /\
Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_xmm 6 va_sM
(va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM
(va_update_xmm 1 va_sM (va_update_reg64 rR12 va_sM (va_update_flags va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : | false | true | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.X64.GF128_Mul.va_wp_ReduceMulRev128 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Vale.Math.Poly2_s.poly ->
b: Vale.Math.Poly2_s.poly ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 30,
"end_line": 86,
"start_col": 2,
"start_line": 76
} |
Prims.Tot | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_Gf128MulRev128 (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 1 va_s0) in let (b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 2 va_s0) in pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ (let (a:Vale.Math.Poly2_s.poly) =
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let (b:Vale.Math.Poly2_s.poly) =
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) ==> va_k va_sM (()))) | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\
(let a:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in
let b:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\
(forall (va_x_efl: Vale.X64.Flags.t)
(va_x_r12: nat64)
(va_x_xmm1: quad32)
(va_x_xmm2: quad32)
(va_x_xmm3: quad32)
(va_x_xmm4: quad32)
(va_x_xmm5: quad32)
(va_x_xmm6: quad32).
let va_sM =
va_upd_xmm 6
va_x_xmm6
(va_upd_xmm 5
va_x_xmm5
(va_upd_xmm 4
va_x_xmm4
(va_upd_xmm 3
va_x_xmm3
(va_upd_xmm 2
va_x_xmm2
(va_upd_xmm 1
va_x_xmm1
(va_upd_reg64 rR12 va_x_r12 (va_upd_flags va_x_efl va_s0)))))))
in
va_get_ok va_sM /\
(let a:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in
let b:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.CPU_Features_s.pclmulqdq_enabled",
"Vale.X64.CPU_Features_s.avx_enabled",
"Vale.X64.CPU_Features_s.sse_enabled",
"Vale.Math.Poly2_s.poly",
"Vale.Math.Poly2.Bits_s.of_quad32",
"Vale.X64.Decls.va_get_xmm",
"Prims.l_Forall",
"Vale.X64.Flags.t",
"Vale.X64.Machine_s.nat64",
"Vale.X64.Decls.quad32",
"Prims.l_imp",
"Prims.eq2",
"Vale.AES.GF128.gf128_mul_rev",
"Vale.X64.State.vale_state",
"Vale.X64.Decls.va_upd_xmm",
"Vale.X64.Decls.va_upd_reg64",
"Vale.X64.Machine_s.rR12",
"Vale.X64.Decls.va_upd_flags"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2;
va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a) (va_wpProof_ShiftLeft128_1 a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
(pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree a <= 127 /\
Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_xmm 6 va_sM
(va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM
(va_update_xmm 1 va_sM (va_update_reg64 rR12 va_sM (va_update_flags va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree
a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12;
va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3;
va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b))
//--
//-- Gf128MulRev128
val va_code_Gf128MulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_Gf128MulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_Gf128MulRev128 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Gf128MulRev128 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
pclmulqdq_enabled /\ avx_enabled /\ sse_enabled)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) /\
va_state_eq va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM
(va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_reg64 rR12
va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0)))))))))))
[@ va_qattr] | false | true | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.X64.GF128_Mul.va_wp_Gf128MulRev128 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 83,
"end_line": 132,
"start_col": 2,
"start_line": 122
} |
Prims.Tot | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a) (va_wpProof_ShiftLeft128_1 a)) | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ()))
let va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) = | false | null | false | (va_QProc (va_code_ShiftLeft128_1 ())
([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a)) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.X64.GF128_Mul.va_code_ShiftLeft128_1",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_xmm",
"Vale.X64.QuickCode.va_Mod_flags",
"Prims.Nil",
"Vale.AES.X64.GF128_Mul.va_wp_ShiftLeft128_1",
"Vale.AES.X64.GF128_Mul.va_wpProof_ShiftLeft128_1",
"Vale.X64.QuickCode.va_quickCode"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2;
va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) | [] | Vale.AES.X64.GF128_Mul.va_quick_ShiftLeft128_1 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Vale.Math.Poly2_s.poly
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.AES.X64.GF128_Mul.va_code_ShiftLeft128_1 ()) | {
"end_col": 59,
"end_line": 52,
"start_col": 2,
"start_line": 51
} |
Prims.Tot | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3;
va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b)) | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ()))
let va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) = | false | null | false | (va_QProc (va_code_ReduceMulRev128 ())
([
va_Mod_xmm 6;
va_Mod_xmm 5;
va_Mod_xmm 4;
va_Mod_xmm 3;
va_Mod_xmm 2;
va_Mod_xmm 1;
va_Mod_reg64 rR12;
va_Mod_flags
])
(va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b)) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.X64.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.X64.GF128_Mul.va_code_ReduceMulRev128",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_xmm",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR12",
"Vale.X64.QuickCode.va_Mod_flags",
"Prims.Nil",
"Vale.AES.X64.GF128_Mul.va_wp_ReduceMulRev128",
"Vale.AES.X64.GF128_Mul.va_wpProof_ReduceMulRev128",
"Vale.X64.QuickCode.va_quickCode"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2;
va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a) (va_wpProof_ShiftLeft128_1 a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
(pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree a <= 127 /\
Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_xmm 6 va_sM
(va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM
(va_update_xmm 1 va_sM (va_update_reg64 rR12 va_sM (va_update_flags va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree
a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12;
va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) | [] | Vale.AES.X64.GF128_Mul.va_quick_ReduceMulRev128 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Vale.Math.Poly2_s.poly -> b: Vale.Math.Poly2_s.poly
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.AES.X64.GF128_Mul.va_code_ReduceMulRev128 ()) | {
"end_col": 37,
"end_line": 99,
"start_col": 2,
"start_line": 97
} |
Prims.Tot | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ())) | [
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_Gf128MulRev128 () : (va_quickCode unit (va_code_Gf128MulRev128 ())) =
(va_QProc (va_code_Gf128MulRev128 ()) ([va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3;
va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags]) va_wp_Gf128MulRev128
va_wpProof_Gf128MulRev128) | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ()))
let va_quick_Gf128MulRev128 () : (va_quickCode unit (va_code_Gf128MulRev128 ())) = | false | null | false | (va_QProc (va_code_Gf128MulRev128 ())
([
va_Mod_xmm 6;
va_Mod_xmm 5;
va_Mod_xmm 4;
va_Mod_xmm 3;
va_Mod_xmm 2;
va_Mod_xmm 1;
va_Mod_reg64 rR12;
va_Mod_flags
])
va_wp_Gf128MulRev128
va_wpProof_Gf128MulRev128) | {
"checked_file": "Vale.AES.X64.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.X64.GF128_Mul.fsti"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.QuickCode.va_QProc",
"Vale.AES.X64.GF128_Mul.va_code_Gf128MulRev128",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_xmm",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR12",
"Vale.X64.QuickCode.va_Mod_flags",
"Prims.Nil",
"Vale.AES.X64.GF128_Mul.va_wp_Gf128MulRev128",
"Vale.AES.X64.GF128_Mul.va_wpProof_Gf128MulRev128",
"Vale.X64.QuickCode.va_quickCode"
] | [] | module Vale.AES.X64.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.X64.Machine_s
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.X64.CPU_Features_s
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_flags va_sM
(va_update_ok va_sM va_s0))))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ avx_enabled /\ sse_enabled /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_xmm
1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_efl:Vale.X64.Flags.t)
(va_x_xmm1:quad32) (va_x_xmm2:quad32) . let va_sM = va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1
va_x_xmm1 (va_upd_flags va_x_efl va_s0)) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2;
va_Mod_xmm 1; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_flags])
(va_wp_ShiftLeft128_1 a) (va_wpProof_ShiftLeft128_1 a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
(pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree a <= 127 /\
Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_xmm 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_xmm 6 va_sM
(va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM (va_update_xmm 2 va_sM
(va_update_xmm 1 va_sM (va_update_reg64 rR12 va_sM (va_update_flags va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ (pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ Vale.Math.Poly2_s.degree
a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_xmm 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_xmm 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ va_get_xmm 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12;
va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_xmm 6; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3;
va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12; va_Mod_flags]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b))
//--
//-- Gf128MulRev128
val va_code_Gf128MulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_Gf128MulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_Gf128MulRev128 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Gf128MulRev128 ()) va_s0 /\ va_get_ok va_s0 /\ (let
(a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
pclmulqdq_enabled /\ avx_enabled /\ sse_enabled)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) /\
va_state_eq va_sM (va_update_xmm 6 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM
(va_update_xmm 3 va_sM (va_update_xmm 2 va_sM (va_update_xmm 1 va_sM (va_update_reg64 rR12
va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0)))))))))))
[@ va_qattr]
let va_wp_Gf128MulRev128 (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 1 va_s0) in let (b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 2 va_s0) in pclmulqdq_enabled /\ avx_enabled /\ sse_enabled) /\ (forall
(va_x_efl:Vale.X64.Flags.t) (va_x_r12:nat64) (va_x_xmm1:quad32) (va_x_xmm2:quad32)
(va_x_xmm3:quad32) (va_x_xmm4:quad32) (va_x_xmm5:quad32) (va_x_xmm6:quad32) . let va_sM =
va_upd_xmm 6 va_x_xmm6 (va_upd_xmm 5 va_x_xmm5 (va_upd_xmm 4 va_x_xmm4 (va_upd_xmm 3 va_x_xmm3
(va_upd_xmm 2 va_x_xmm2 (va_upd_xmm 1 va_x_xmm1 (va_upd_reg64 rR12 va_x_r12 (va_upd_flags
va_x_efl va_s0))))))) in va_get_ok va_sM /\ (let (a:Vale.Math.Poly2_s.poly) =
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 1 va_s0) in let (b:Vale.Math.Poly2_s.poly) =
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_xmm 2 va_s0) in Vale.Math.Poly2.Bits_s.of_quad32
(va_get_xmm 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) ==> va_k va_sM (())))
val va_wpProof_Gf128MulRev128 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Gf128MulRev128 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Gf128MulRev128 ()) ([va_Mod_xmm 6;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 2; va_Mod_xmm 1; va_Mod_reg64 rR12;
va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.X64.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ())) | [] | Vale.AES.X64.GF128_Mul.va_quick_Gf128MulRev128 | {
"file_name": "obj/Vale.AES.X64.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.AES.X64.GF128_Mul.va_code_Gf128MulRev128 ()) | {
"end_col": 30,
"end_line": 144,
"start_col": 2,
"start_line": 142
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let grouped_fields = either field bitfield_group | let grouped_fields = | false | null | false | either field bitfield_group | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"total"
] | [
"Ast.either",
"Ast.field",
"BitFields.bitfield_group"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*) | false | true | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val grouped_fields : Type0 | [] | BitFields.grouped_fields | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | Type0 | {
"end_col": 48,
"end_line": 32,
"start_col": 21,
"start_line": 32
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let subst' = list (ident & expr) | let subst' = | false | null | false | list (ident & expr) | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"total"
] | [
"Prims.list",
"FStar.Pervasives.Native.tuple2",
"Ast.ident",
"Ast.expr"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*)
let bitfield_group = int & typ & list atomic_field
let grouped_fields = either field bitfield_group
let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field)
: ML (list grouped_fields)
= List.fold_right
(fun field out ->
match field.v with
| RecordField _ _
| SwitchCaseField _ _ ->
Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None ->
Inl field :: out
| Some (Inl _) ->
failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields)::tl ->
if index = bf.v.bitfield_identifier
then Inr(index, typ, af :: atomic_fields) :: tl //extend this bitfield group
else Inr(bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
)
fields
[] | false | true | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val subst' : Type0 | [] | BitFields.subst' | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | Type0 | {
"end_col": 32,
"end_line": 64,
"start_col": 13,
"start_line": 64
} |
|
FStar.All.ML | val eliminate_decls (env: B.global_env) (ds: list decl) : ML (list decl) | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let eliminate_decls (env:B.global_env) (ds:list decl) : ML (list decl) =
List.map (eliminate_one_decl env) ds | val eliminate_decls (env: B.global_env) (ds: list decl) : ML (list decl)
let eliminate_decls (env: B.global_env) (ds: list decl) : ML (list decl) = | true | null | false | List.map (eliminate_one_decl env) ds | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"ml"
] | [
"GlobalEnv.global_env",
"Prims.list",
"Ast.decl",
"FStar.List.map",
"BitFields.eliminate_one_decl"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*)
let bitfield_group = int & typ & list atomic_field
let grouped_fields = either field bitfield_group
let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field)
: ML (list grouped_fields)
= List.fold_right
(fun field out ->
match field.v with
| RecordField _ _
| SwitchCaseField _ _ ->
Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None ->
Inl field :: out
| Some (Inl _) ->
failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields)::tl ->
if index = bf.v.bitfield_identifier
then Inr(index, typ, af :: atomic_fields) :: tl //extend this bitfield group
else Inr(bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
)
fields
[]
let subst' = list (ident & expr)
let coalesce_grouped_bit_field env (f:bitfield_group)
: ML (field & subst')
= let id, typ, fields = f in
let size = B.size_of_integral_typ env typ typ.range in
let bitsize = 8 * size in
let order = B.bit_order_of_integral_typ env typ typ.range in
let field_id = with_range (to_ident' (Printf.sprintf "__bitfield_%d" id)) dummy_range in
let id = with_range (Identifier field_id) field_id.range in
let mk_e (e:expr') :expr = with_range e field_id.range in
let bitfield_attrs f : ML _ =
match f.field_bitwidth with
| Some (Inr bf) -> bf.v
| _ -> failwith "Must have elaborated bitfield"
in
let field_dependence, field_constraint, field_action, subst =
List.fold_left
(fun (acc:(bool & _ & option (action & bool) & _)) f ->
let (dep, acc_constraint, acc_action, subst) = acc in
let f = f.v in
let acc_action, acc_dep =
match acc_action, f.field_action with
| None, None
| Some _, None -> acc_action, false
| None, Some (_, d) -> f.field_action, d
| Some (acc, dep_0), Some (fa, dep_1) ->
if Action_act? acc.v
&& Action_act? fa.v
then
Some (Ast.sequence_non_failing_actions acc fa, dep_0 || dep_1),
dep_0 || dep_1
else
failwith "Multiple, potentially failing actions are not supported on bitfields"
in
let dep = dep || acc_dep || f.field_dependence in
let acc_constraint =
match f.field_constraint, acc_constraint with
| None, _ -> acc_constraint
| Some _, None -> f.field_constraint
| Some c, Some acc -> Some (mk_e (App And [acc; c]))
in
let bf_exp =
App
(BitFieldOf bitsize order)
[id;
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_from));
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_to))]
in
let subst = (f.field_ident, mk_e bf_exp) :: subst in
dep, acc_constraint, acc_action, subst)
(false, None, None, [])
fields
in
let struct_field = {
field_dependence = field_dependence;
field_ident = field_id;
field_type = typ;
field_array_opt = FieldScalar;
field_constraint = field_constraint;
field_bitwidth = None;
field_action = field_action;
} in
let af = with_dummy_range struct_field in
with_dummy_range (AtomicField af),
subst
let rec rewrite_field (env:B.global_env) (f:field)
: ML (f':field {field_tag_equal f f'})
= match f.v with
| AtomicField _ -> f
| RecordField fs field_name ->
let gfs = group_bit_fields (rewrite_field env) fs in
let fs, subst =
List.fold_right
(fun f (fields, subst) ->
match f with
| Inl f -> (f::fields, subst)
| Inr gf ->
let f, subst' = coalesce_grouped_bit_field (B.mk_env env) gf in
f::fields, subst'@subst)
gfs
([], [])
in
let fs = List.map (subst_field (mk_subst subst)) fs in
{ f with v = RecordField fs field_name }
| SwitchCaseField (e, cases) field_name ->
let cases =
List.map
(function
| Case p f ->
Case p (rewrite_field env f)
| DefaultCase f ->
DefaultCase (rewrite_field env f))
cases
in
{ f with v = SwitchCaseField (e, cases) field_name }
let eliminate_one_decl (env:B.global_env) (d:decl) : ML decl =
match d.d_decl.v with
| Record names params where fields ->
let i = with_dummy_range (to_ident' "_") in
let { v = RecordField fields _ } = rewrite_field env (with_dummy_range (RecordField fields i)) in
List.iter (fun f ->
Options.debug_print_string
(Printf.sprintf "Bitfields: Field %s has comments <%s>\n"
(print_field f)
(String.concat "\n" f.comments))) fields;
let fields =
match fields with
| [{v=AtomicField af; range; comments}] -> //just one field, it need no longer be dependent
let af' = { af.v with field_dependence = false } in
let af' = { af with v = af' } in
[{v=AtomicField af; range; comments}]
| _ -> fields
in
decl_with_v d (Record names params where fields)
| _ -> d | false | false | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val eliminate_decls (env: B.global_env) (ds: list decl) : ML (list decl) | [] | BitFields.eliminate_decls | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | env: GlobalEnv.global_env -> ds: Prims.list Ast.decl -> FStar.All.ML (Prims.list Ast.decl) | {
"end_col": 38,
"end_line": 189,
"start_col": 2,
"start_line": 189
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bitfield_group = int & typ & list atomic_field | let bitfield_group = | false | null | false | int & typ & list atomic_field | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"total"
] | [
"FStar.Pervasives.Native.tuple3",
"Prims.int",
"Ast.typ",
"Prims.list",
"Ast.atomic_field"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*) | false | true | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val bitfield_group : Type0 | [] | BitFields.bitfield_group | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | Type0 | {
"end_col": 50,
"end_line": 31,
"start_col": 21,
"start_line": 31
} |
|
FStar.All.ML | val group_bit_fields (rewrite_composite_field: (field -> ML field)) (fields: list field)
: ML (list grouped_fields) | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field)
: ML (list grouped_fields)
= List.fold_right
(fun field out ->
match field.v with
| RecordField _ _
| SwitchCaseField _ _ ->
Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None ->
Inl field :: out
| Some (Inl _) ->
failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields)::tl ->
if index = bf.v.bitfield_identifier
then Inr(index, typ, af :: atomic_fields) :: tl //extend this bitfield group
else Inr(bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
)
fields
[] | val group_bit_fields (rewrite_composite_field: (field -> ML field)) (fields: list field)
: ML (list grouped_fields)
let group_bit_fields (rewrite_composite_field: (field -> ML field)) (fields: list field)
: ML (list grouped_fields) = | true | null | false | List.fold_right (fun field out ->
match field.v with
| RecordField _ _ | SwitchCaseField _ _ -> Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None -> Inl field :: out
| Some (Inl _) -> failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields) :: tl ->
if index = bf.v.bitfield_identifier
then Inr (index, typ, af :: atomic_fields) :: tl
else Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out)
fields
[] | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"ml"
] | [
"Ast.field",
"Prims.list",
"FStar.List.fold_right",
"Ast.with_meta_t",
"Ast.field'",
"Ast.either",
"FStar.Pervasives.Native.tuple3",
"Prims.int",
"Ast.typ",
"Ast.atomic_field'",
"Ast.__proj__Mkwith_meta_t__item__v",
"Ast.ident",
"Prims.Cons",
"Ast.Inl",
"FStar.Pervasives.Native.tuple2",
"Ast.expr",
"Ast.case",
"Ast.__proj__Mkatomic_field'__item__field_bitwidth",
"FStar.All.failwith",
"Ast.bitfield_attr",
"Prims.op_Equality",
"Ast.__proj__Mkbitfield_attr'__item__bitfield_identifier",
"Ast.bitfield_attr'",
"Ast.Inr",
"FStar.Pervasives.Native.Mktuple3",
"Prims.bool",
"Ast.__proj__Mkbitfield_attr'__item__bitfield_type",
"Prims.Nil",
"BitFields.grouped_fields"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*)
let bitfield_group = int & typ & list atomic_field
let grouped_fields = either field bitfield_group
let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field) | false | false | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val group_bit_fields (rewrite_composite_field: (field -> ML field)) (fields: list field)
: ML (list grouped_fields) | [] | BitFields.group_bit_fields | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | rewrite_composite_field: (_: Ast.field -> FStar.All.ML Ast.field) -> fields: Prims.list Ast.field
-> FStar.All.ML (Prims.list BitFields.grouped_fields) | {
"end_col": 9,
"end_line": 62,
"start_col": 4,
"start_line": 37
} |
FStar.All.ML | val rewrite_field (env: B.global_env) (f: field) : ML (f': field{field_tag_equal f f'}) | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec rewrite_field (env:B.global_env) (f:field)
: ML (f':field {field_tag_equal f f'})
= match f.v with
| AtomicField _ -> f
| RecordField fs field_name ->
let gfs = group_bit_fields (rewrite_field env) fs in
let fs, subst =
List.fold_right
(fun f (fields, subst) ->
match f with
| Inl f -> (f::fields, subst)
| Inr gf ->
let f, subst' = coalesce_grouped_bit_field (B.mk_env env) gf in
f::fields, subst'@subst)
gfs
([], [])
in
let fs = List.map (subst_field (mk_subst subst)) fs in
{ f with v = RecordField fs field_name }
| SwitchCaseField (e, cases) field_name ->
let cases =
List.map
(function
| Case p f ->
Case p (rewrite_field env f)
| DefaultCase f ->
DefaultCase (rewrite_field env f))
cases
in
{ f with v = SwitchCaseField (e, cases) field_name } | val rewrite_field (env: B.global_env) (f: field) : ML (f': field{field_tag_equal f f'})
let rec rewrite_field (env: B.global_env) (f: field) : ML (f': field{field_tag_equal f f'}) = | true | null | false | match f.v with
| AtomicField _ -> f
| RecordField fs field_name ->
let gfs = group_bit_fields (rewrite_field env) fs in
let fs, subst =
List.fold_right (fun f (fields, subst) ->
match f with
| Inl f -> (f :: fields, subst)
| Inr gf ->
let f, subst' = coalesce_grouped_bit_field (B.mk_env env) gf in
f :: fields, subst' @ subst)
gfs
([], [])
in
let fs = List.map (subst_field (mk_subst subst)) fs in
{ f with v = RecordField fs field_name }
| SwitchCaseField (e, cases) field_name ->
let cases =
List.map (function
| Case p f -> Case p (rewrite_field env f)
| DefaultCase f -> DefaultCase (rewrite_field env f))
cases
in
{ f with v = SwitchCaseField (e, cases) field_name } | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"ml"
] | [
"GlobalEnv.global_env",
"Ast.field",
"Ast.__proj__Mkwith_meta_t__item__v",
"Ast.field'",
"Ast.with_meta_t",
"Ast.atomic_field'",
"Prims.b2t",
"Ast.field_tag_equal",
"Prims.list",
"Ast.ident",
"FStar.Pervasives.Native.tuple2",
"Ast.expr",
"Ast.Mkwith_meta_t",
"Ast.RecordField",
"Ast.__proj__Mkwith_meta_t__item__range",
"Ast.__proj__Mkwith_meta_t__item__comments",
"FStar.List.map",
"Ast.subst_field",
"Ast.subst",
"Ast.mk_subst",
"FStar.List.fold_right",
"Ast.either",
"BitFields.bitfield_group",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Cons",
"BitFields.subst'",
"FStar.List.Tot.Base.op_At",
"BitFields.coalesce_grouped_bit_field",
"Binding.env",
"Binding.mk_env",
"Prims.Nil",
"BitFields.grouped_fields",
"BitFields.group_bit_fields",
"BitFields.rewrite_field",
"Ast.case",
"Ast.SwitchCaseField",
"Ast.Case",
"Ast.DefaultCase"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*)
let bitfield_group = int & typ & list atomic_field
let grouped_fields = either field bitfield_group
let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field)
: ML (list grouped_fields)
= List.fold_right
(fun field out ->
match field.v with
| RecordField _ _
| SwitchCaseField _ _ ->
Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None ->
Inl field :: out
| Some (Inl _) ->
failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields)::tl ->
if index = bf.v.bitfield_identifier
then Inr(index, typ, af :: atomic_fields) :: tl //extend this bitfield group
else Inr(bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
)
fields
[]
let subst' = list (ident & expr)
let coalesce_grouped_bit_field env (f:bitfield_group)
: ML (field & subst')
= let id, typ, fields = f in
let size = B.size_of_integral_typ env typ typ.range in
let bitsize = 8 * size in
let order = B.bit_order_of_integral_typ env typ typ.range in
let field_id = with_range (to_ident' (Printf.sprintf "__bitfield_%d" id)) dummy_range in
let id = with_range (Identifier field_id) field_id.range in
let mk_e (e:expr') :expr = with_range e field_id.range in
let bitfield_attrs f : ML _ =
match f.field_bitwidth with
| Some (Inr bf) -> bf.v
| _ -> failwith "Must have elaborated bitfield"
in
let field_dependence, field_constraint, field_action, subst =
List.fold_left
(fun (acc:(bool & _ & option (action & bool) & _)) f ->
let (dep, acc_constraint, acc_action, subst) = acc in
let f = f.v in
let acc_action, acc_dep =
match acc_action, f.field_action with
| None, None
| Some _, None -> acc_action, false
| None, Some (_, d) -> f.field_action, d
| Some (acc, dep_0), Some (fa, dep_1) ->
if Action_act? acc.v
&& Action_act? fa.v
then
Some (Ast.sequence_non_failing_actions acc fa, dep_0 || dep_1),
dep_0 || dep_1
else
failwith "Multiple, potentially failing actions are not supported on bitfields"
in
let dep = dep || acc_dep || f.field_dependence in
let acc_constraint =
match f.field_constraint, acc_constraint with
| None, _ -> acc_constraint
| Some _, None -> f.field_constraint
| Some c, Some acc -> Some (mk_e (App And [acc; c]))
in
let bf_exp =
App
(BitFieldOf bitsize order)
[id;
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_from));
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_to))]
in
let subst = (f.field_ident, mk_e bf_exp) :: subst in
dep, acc_constraint, acc_action, subst)
(false, None, None, [])
fields
in
let struct_field = {
field_dependence = field_dependence;
field_ident = field_id;
field_type = typ;
field_array_opt = FieldScalar;
field_constraint = field_constraint;
field_bitwidth = None;
field_action = field_action;
} in
let af = with_dummy_range struct_field in
with_dummy_range (AtomicField af),
subst
let rec rewrite_field (env:B.global_env) (f:field) | false | false | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rewrite_field (env: B.global_env) (f: field) : ML (f': field{field_tag_equal f f'}) | [
"recursion"
] | BitFields.rewrite_field | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | env: GlobalEnv.global_env -> f: Ast.field -> FStar.All.ML (f': Ast.field{Ast.field_tag_equal f f'}) | {
"end_col": 58,
"end_line": 163,
"start_col": 4,
"start_line": 133
} |
FStar.All.ML | val eliminate_one_decl (env: B.global_env) (d: decl) : ML decl | [
{
"abbrev": true,
"full_module": "Hashtable",
"short_module": "H"
},
{
"abbrev": true,
"full_module": "Binding",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "Ast",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let eliminate_one_decl (env:B.global_env) (d:decl) : ML decl =
match d.d_decl.v with
| Record names params where fields ->
let i = with_dummy_range (to_ident' "_") in
let { v = RecordField fields _ } = rewrite_field env (with_dummy_range (RecordField fields i)) in
List.iter (fun f ->
Options.debug_print_string
(Printf.sprintf "Bitfields: Field %s has comments <%s>\n"
(print_field f)
(String.concat "\n" f.comments))) fields;
let fields =
match fields with
| [{v=AtomicField af; range; comments}] -> //just one field, it need no longer be dependent
let af' = { af.v with field_dependence = false } in
let af' = { af with v = af' } in
[{v=AtomicField af; range; comments}]
| _ -> fields
in
decl_with_v d (Record names params where fields)
| _ -> d | val eliminate_one_decl (env: B.global_env) (d: decl) : ML decl
let eliminate_one_decl (env: B.global_env) (d: decl) : ML decl = | true | null | false | match d.d_decl.v with
| Record names params where fields ->
let i = with_dummy_range (to_ident' "_") in
let { v = RecordField fields _ } = rewrite_field env (with_dummy_range (RecordField fields i)) in
List.iter (fun f ->
Options.debug_print_string (Printf.sprintf "Bitfields: Field %s has comments <%s>\n"
(print_field f)
(String.concat "\n" f.comments)))
fields;
let fields =
match fields with
| [{ v = AtomicField af ; range = range ; comments = comments }] ->
let af' = { af.v with field_dependence = false } in
let af' = { af with v = af' } in
[{ v = AtomicField af; range = range; comments = comments }]
| _ -> fields
in
decl_with_v d (Record names params where fields)
| _ -> d | {
"checked_file": "BitFields.fst.checked",
"dependencies": [
"prims.fst.checked",
"Options.fsti.checked",
"Hashtable.fsti.checked",
"FStar.String.fsti.checked",
"FStar.Printf.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.All.fst.checked",
"Binding.fsti.checked",
"Ast.fst.checked"
],
"interface_file": false,
"source_file": "BitFields.fst"
} | [
"ml"
] | [
"GlobalEnv.global_env",
"Ast.decl",
"Ast.__proj__Mkwith_meta_t__item__v",
"Ast.decl'",
"Ast.__proj__Mkdecl__item__d_decl",
"Ast.typedef_names",
"Prims.list",
"Ast.param",
"FStar.Pervasives.Native.option",
"Ast.expr",
"Ast.record",
"Ast.with_meta_t",
"Ast.field'",
"Ast.ident",
"Ast.range",
"Ast.comments",
"Ast.decl_with_v",
"Ast.Record",
"Ast.atomic_field'",
"Prims.Cons",
"Ast.Mkwith_meta_t",
"Ast.AtomicField",
"Prims.Nil",
"Ast.__proj__Mkwith_meta_t__item__range",
"Ast.__proj__Mkwith_meta_t__item__comments",
"Ast.Mkatomic_field'",
"Ast.__proj__Mkatomic_field'__item__field_ident",
"Ast.__proj__Mkatomic_field'__item__field_type",
"Ast.__proj__Mkatomic_field'__item__field_array_opt",
"Ast.__proj__Mkatomic_field'__item__field_constraint",
"Ast.__proj__Mkatomic_field'__item__field_bitwidth",
"Ast.__proj__Mkatomic_field'__item__field_action",
"Prims.unit",
"FStar.List.iter",
"Options.debug_print_string",
"Prims.string",
"FStar.String.concat",
"FStar.Printf.sprintf",
"Ast.print_field",
"Ast.field",
"Prims.b2t",
"Ast.field_tag_equal",
"Ast.with_dummy_range",
"Ast.RecordField",
"BitFields.rewrite_field",
"Ast.ident'",
"Ast.to_ident'"
] | [] | (*
Copyright 2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module BitFields
open FStar.List.Tot
open FStar.Mul
open Ast
open FStar.All
module B = Binding
module H = Hashtable
(* This module implements a pass over the source AST
coalescing adjacent bit fields and replacing expressions on
bitfields using offsets into larger fgields
*)
let bitfield_group = int & typ & list atomic_field
let grouped_fields = either field bitfield_group
let group_bit_fields (rewrite_composite_field: field -> ML field)
(fields: list field)
: ML (list grouped_fields)
= List.fold_right
(fun field out ->
match field.v with
| RecordField _ _
| SwitchCaseField _ _ ->
Inl (rewrite_composite_field field) :: out
| AtomicField af ->
match af.v.field_bitwidth with
| None ->
Inl field :: out
| Some (Inl _) ->
failwith "Bit fields should have been elaborated already"
| Some (Inr bf) ->
match out with
| Inr (index, typ, atomic_fields)::tl ->
if index = bf.v.bitfield_identifier
then Inr(index, typ, af :: atomic_fields) :: tl //extend this bitfield group
else Inr(bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
| _ -> Inr (bf.v.bitfield_identifier, bf.v.bitfield_type, [af]) :: out //new bitfield group
)
fields
[]
let subst' = list (ident & expr)
let coalesce_grouped_bit_field env (f:bitfield_group)
: ML (field & subst')
= let id, typ, fields = f in
let size = B.size_of_integral_typ env typ typ.range in
let bitsize = 8 * size in
let order = B.bit_order_of_integral_typ env typ typ.range in
let field_id = with_range (to_ident' (Printf.sprintf "__bitfield_%d" id)) dummy_range in
let id = with_range (Identifier field_id) field_id.range in
let mk_e (e:expr') :expr = with_range e field_id.range in
let bitfield_attrs f : ML _ =
match f.field_bitwidth with
| Some (Inr bf) -> bf.v
| _ -> failwith "Must have elaborated bitfield"
in
let field_dependence, field_constraint, field_action, subst =
List.fold_left
(fun (acc:(bool & _ & option (action & bool) & _)) f ->
let (dep, acc_constraint, acc_action, subst) = acc in
let f = f.v in
let acc_action, acc_dep =
match acc_action, f.field_action with
| None, None
| Some _, None -> acc_action, false
| None, Some (_, d) -> f.field_action, d
| Some (acc, dep_0), Some (fa, dep_1) ->
if Action_act? acc.v
&& Action_act? fa.v
then
Some (Ast.sequence_non_failing_actions acc fa, dep_0 || dep_1),
dep_0 || dep_1
else
failwith "Multiple, potentially failing actions are not supported on bitfields"
in
let dep = dep || acc_dep || f.field_dependence in
let acc_constraint =
match f.field_constraint, acc_constraint with
| None, _ -> acc_constraint
| Some _, None -> f.field_constraint
| Some c, Some acc -> Some (mk_e (App And [acc; c]))
in
let bf_exp =
App
(BitFieldOf bitsize order)
[id;
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_from));
mk_e (Constant (Int UInt32 (bitfield_attrs f).bitfield_to))]
in
let subst = (f.field_ident, mk_e bf_exp) :: subst in
dep, acc_constraint, acc_action, subst)
(false, None, None, [])
fields
in
let struct_field = {
field_dependence = field_dependence;
field_ident = field_id;
field_type = typ;
field_array_opt = FieldScalar;
field_constraint = field_constraint;
field_bitwidth = None;
field_action = field_action;
} in
let af = with_dummy_range struct_field in
with_dummy_range (AtomicField af),
subst
let rec rewrite_field (env:B.global_env) (f:field)
: ML (f':field {field_tag_equal f f'})
= match f.v with
| AtomicField _ -> f
| RecordField fs field_name ->
let gfs = group_bit_fields (rewrite_field env) fs in
let fs, subst =
List.fold_right
(fun f (fields, subst) ->
match f with
| Inl f -> (f::fields, subst)
| Inr gf ->
let f, subst' = coalesce_grouped_bit_field (B.mk_env env) gf in
f::fields, subst'@subst)
gfs
([], [])
in
let fs = List.map (subst_field (mk_subst subst)) fs in
{ f with v = RecordField fs field_name }
| SwitchCaseField (e, cases) field_name ->
let cases =
List.map
(function
| Case p f ->
Case p (rewrite_field env f)
| DefaultCase f ->
DefaultCase (rewrite_field env f))
cases
in
{ f with v = SwitchCaseField (e, cases) field_name } | false | false | BitFields.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val eliminate_one_decl (env: B.global_env) (d: decl) : ML decl | [] | BitFields.eliminate_one_decl | {
"file_name": "src/3d/BitFields.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | env: GlobalEnv.global_env -> d: Ast.decl -> FStar.All.ML Ast.decl | {
"end_col": 10,
"end_line": 186,
"start_col": 2,
"start_line": 167
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap32 = opaque_make update_heap32_def | let update_heap32 = | false | null | false | opaque_make update_heap32_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap32_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap32 : _: Prims.int -> _: Vale.Def.Types_s.nat32 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap32 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Def.Types_s.nat32 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 68,
"end_line": 55,
"start_col": 39,
"start_line": 55
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val64 = opaque_make get_heap_val64_def | let get_heap_val64 = | false | null | false | opaque_make get_heap_val64_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.nat64",
"Vale.Arch.MachineHeap_s.get_heap_val64_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7])) | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val64 : _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat64 | [] | Vale.Arch.MachineHeap_s.get_heap_val64 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat64 | {
"end_col": 70,
"end_line": 37,
"start_col": 40,
"start_line": 37
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val32 = opaque_make get_heap_val32_def | let get_heap_val32 = | false | null | false | opaque_make get_heap_val32_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.get_heap_val32_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2] | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val32 : _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat32 | [] | Vale.Arch.MachineHeap_s.get_heap_val32 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat32 | {
"end_col": 70,
"end_line": 28,
"start_col": 40,
"start_line": 28
} |
|
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def | let update_heap32_reveal = | false | null | true | opaque_revealer (`%update_heap32) update_heap32 update_heap32_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap32",
"Vale.Arch.MachineHeap_s.update_heap32_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap32_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap32 == Vale.Arch.MachineHeap_s.update_heap32_def) | [] | Vale.Arch.MachineHeap_s.update_heap32_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap32 == Vale.Arch.MachineHeap_s.update_heap32_def) | {
"end_col": 104,
"end_line": 56,
"start_col": 39,
"start_line": 56
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem | let update_heap128_def (ptr: int) (v: quad32) (mem: machine_heap) = | false | null | false | let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Def.Types_s.quad32",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap32",
"Prims.op_Addition",
"Vale.Def.Words_s.__proj__Mkfour__item__hi3",
"Vale.Def.Types_s.nat32",
"Vale.Def.Words_s.__proj__Mkfour__item__hi2",
"Vale.Def.Words_s.__proj__Mkfour__item__lo1",
"Vale.Def.Words_s.__proj__Mkfour__item__lo0"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap128_def : ptr: Prims.int -> v: Vale.Def.Types_s.quad32 -> mem: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap128_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> v: Vale.Def.Types_s.quad32 -> mem: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 5,
"end_line": 79,
"start_col": 64,
"start_line": 74
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let machine_heap = Map.t int nat8 | let machine_heap = | false | null | false | Map.t int nat8 | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"FStar.Map.t",
"Prims.int",
"Vale.Def.Types_s.nat8"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val machine_heap : Type0 | [] | Vale.Arch.MachineHeap_s.machine_heap | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 33,
"end_line": 14,
"start_col": 19,
"start_line": 14
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val128 = opaque_make get_heap_val128_def | let get_heap_val128 = | false | null | false | opaque_make get_heap_val128_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.quad32",
"Vale.Arch.MachineHeap_s.get_heap_val128_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem) | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val128 : _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.quad32 | [] | Vale.Arch.MachineHeap_s.get_heap_val128 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.quad32 | {
"end_col": 72,
"end_line": 45,
"start_col": 41,
"start_line": 45
} |
|
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def | let get_heap_val128_reveal = | false | null | true | opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.quad32",
"Vale.Arch.MachineHeap_s.get_heap_val128",
"Vale.Arch.MachineHeap_s.get_heap_val128_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem) | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val128_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val128 == Vale.Arch.MachineHeap_s.get_heap_val128_def) | [] | Vale.Arch.MachineHeap_s.get_heap_val128_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val128 == Vale.Arch.MachineHeap_s.get_heap_val128_def) | {
"end_col": 112,
"end_line": 46,
"start_col": 41,
"start_line": 46
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap128 = opaque_make update_heap128_def | let update_heap128 = | false | null | false | opaque_make update_heap128_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Def.Types_s.quad32",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap128_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def
let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap128 : _: Prims.int -> _: Vale.Def.Types_s.quad32 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap128 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Def.Types_s.quad32 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 70,
"end_line": 80,
"start_col": 40,
"start_line": 80
} |
|
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def | let update_heap64_reveal = | false | null | true | opaque_revealer (`%update_heap64) update_heap64 update_heap64_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Def.Types_s.nat64",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap64",
"Vale.Arch.MachineHeap_s.update_heap64_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap64_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap64 == Vale.Arch.MachineHeap_s.update_heap64_def) | [] | Vale.Arch.MachineHeap_s.update_heap64_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap64 == Vale.Arch.MachineHeap_s.update_heap64_def) | {
"end_col": 104,
"end_line": 72,
"start_col": 39,
"start_line": 72
} |
|
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def | let get_heap_val32_reveal = | false | null | true | opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.get_heap_val32",
"Vale.Arch.MachineHeap_s.get_heap_val32_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3]) | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val32_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val32 == Vale.Arch.MachineHeap_s.get_heap_val32_def) | [] | Vale.Arch.MachineHeap_s.get_heap_val32_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val32 == Vale.Arch.MachineHeap_s.get_heap_val32_def) | {
"end_col": 108,
"end_line": 29,
"start_col": 40,
"start_line": 29
} |
|
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap128_reveal = opaque_revealer (`%update_heap128) update_heap128 update_heap128_def | let update_heap128_reveal = | false | null | true | opaque_revealer (`%update_heap128) update_heap128 update_heap128_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Def.Types_s.quad32",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap128",
"Vale.Arch.MachineHeap_s.update_heap128_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def
let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap128_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap128 == Vale.Arch.MachineHeap_s.update_heap128_def) | [] | Vale.Arch.MachineHeap_s.update_heap128_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.update_heap128 == Vale.Arch.MachineHeap_s.update_heap128_def) | {
"end_col": 108,
"end_line": 81,
"start_col": 40,
"start_line": 81
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap64 = opaque_make update_heap64_def | let update_heap64 = | false | null | false | opaque_make update_heap64_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Def.Opaque_s.opaque_make",
"Prims.int",
"Vale.Def.Types_s.nat64",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Arch.MachineHeap_s.update_heap64_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap64 : _: Prims.int -> _: Vale.Def.Types_s.nat64 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap64 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.int -> _: Vale.Def.Types_s.nat64 -> _: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 68,
"end_line": 71,
"start_col": 39,
"start_line": 71
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_addr64 (ptr:int) (mem:machine_heap) =
valid_addr ptr mem &&
valid_addr (ptr + 1) mem &&
valid_addr (ptr + 2) mem &&
valid_addr (ptr + 3) mem &&
valid_addr (ptr + 4) mem &&
valid_addr (ptr + 5) mem &&
valid_addr (ptr + 6) mem &&
valid_addr (ptr + 7) mem | let valid_addr64 (ptr: int) (mem: machine_heap) = | false | null | false | valid_addr ptr mem && valid_addr (ptr + 1) mem && valid_addr (ptr + 2) mem &&
valid_addr (ptr + 3) mem &&
valid_addr (ptr + 4) mem &&
valid_addr (ptr + 5) mem &&
valid_addr (ptr + 6) mem &&
valid_addr (ptr + 7) mem | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Prims.op_AmpAmp",
"Vale.Arch.MachineHeap_s.valid_addr",
"Prims.op_Addition",
"Prims.bool"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def
let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem
[@"opaque_to_smt"] let update_heap128 = opaque_make update_heap128_def
irreducible let update_heap128_reveal = opaque_revealer (`%update_heap128) update_heap128 update_heap128_def
let valid_addr (ptr:int) (mem:machine_heap) : bool =
Map.contains mem ptr
[@"opaque_to_smt"] | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val valid_addr64 : ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Prims.bool | [] | Vale.Arch.MachineHeap_s.valid_addr64 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Prims.bool | {
"end_col": 26,
"end_line": 95,
"start_col": 2,
"start_line": 88
} |
|
Prims.Tot | val get_heap_val128_def (ptr: int) (mem: machine_heap) : quad32 | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem) | val get_heap_val128_def (ptr: int) (mem: machine_heap) : quad32
let get_heap_val128_def (ptr: int) (mem: machine_heap) : quad32 = | false | null | false | Mkfour (get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem) | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Words_s.Mkfour",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.get_heap_val32",
"Prims.op_Addition",
"Vale.Def.Types_s.quad32"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val128_def (ptr: int) (mem: machine_heap) : quad32 | [] | Vale.Arch.MachineHeap_s.get_heap_val128_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.quad32 | {
"end_col": 33,
"end_line": 44,
"start_col": 64,
"start_line": 40
} |
FStar.Pervasives.Lemma | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def | let get_heap_val64_reveal = | false | null | true | opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"lemma"
] | [
"Vale.Def.Opaque_s.opaque_revealer",
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Types_s.nat64",
"Vale.Arch.MachineHeap_s.get_heap_val64",
"Vale.Arch.MachineHeap_s.get_heap_val64_def"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
) | false | false | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val64_reveal : _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val64 == Vale.Arch.MachineHeap_s.get_heap_val64_def) | [] | Vale.Arch.MachineHeap_s.get_heap_val64_reveal | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures Vale.Arch.MachineHeap_s.get_heap_val64 == Vale.Arch.MachineHeap_s.get_heap_val64_def) | {
"end_col": 108,
"end_line": 38,
"start_col": 40,
"start_line": 38
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_addr128 (ptr:int) (mem:machine_heap) =
valid_addr ptr mem &&
valid_addr (ptr + 1) mem &&
valid_addr (ptr + 2) mem &&
valid_addr (ptr + 3) mem &&
valid_addr (ptr + 4) mem &&
valid_addr (ptr + 5) mem &&
valid_addr (ptr + 6) mem &&
valid_addr (ptr + 7) mem &&
valid_addr (ptr + 8) mem &&
valid_addr (ptr + 9) mem &&
valid_addr (ptr + 10) mem &&
valid_addr (ptr + 11) mem &&
valid_addr (ptr + 12) mem &&
valid_addr (ptr + 13) mem &&
valid_addr (ptr + 14) mem &&
valid_addr (ptr + 15) mem | let valid_addr128 (ptr: int) (mem: machine_heap) = | false | null | false | valid_addr ptr mem && valid_addr (ptr + 1) mem && valid_addr (ptr + 2) mem &&
valid_addr (ptr + 3) mem &&
valid_addr (ptr + 4) mem &&
valid_addr (ptr + 5) mem &&
valid_addr (ptr + 6) mem &&
valid_addr (ptr + 7) mem &&
valid_addr (ptr + 8) mem &&
valid_addr (ptr + 9) mem &&
valid_addr (ptr + 10) mem &&
valid_addr (ptr + 11) mem &&
valid_addr (ptr + 12) mem &&
valid_addr (ptr + 13) mem &&
valid_addr (ptr + 14) mem &&
valid_addr (ptr + 15) mem | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Prims.op_AmpAmp",
"Vale.Arch.MachineHeap_s.valid_addr",
"Prims.op_Addition",
"Prims.bool"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def
let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem
[@"opaque_to_smt"] let update_heap128 = opaque_make update_heap128_def
irreducible let update_heap128_reveal = opaque_revealer (`%update_heap128) update_heap128 update_heap128_def
let valid_addr (ptr:int) (mem:machine_heap) : bool =
Map.contains mem ptr
[@"opaque_to_smt"]
let valid_addr64 (ptr:int) (mem:machine_heap) =
valid_addr ptr mem &&
valid_addr (ptr + 1) mem &&
valid_addr (ptr + 2) mem &&
valid_addr (ptr + 3) mem &&
valid_addr (ptr + 4) mem &&
valid_addr (ptr + 5) mem &&
valid_addr (ptr + 6) mem &&
valid_addr (ptr + 7) mem
[@"opaque_to_smt"] | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val valid_addr128 : ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Prims.bool | [] | Vale.Arch.MachineHeap_s.valid_addr128 | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Prims.bool | {
"end_col": 27,
"end_line": 114,
"start_col": 2,
"start_line": 99
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i) | let is_machine_heap_update (mh mh': machine_heap) = | false | null | false | Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i: int). {:pattern Map.sel mh i\/Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i) | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Vale.Arch.MachineHeap_s.machine_heap",
"Prims.l_and",
"FStar.Set.equal",
"Prims.int",
"FStar.Map.domain",
"Vale.Def.Types_s.nat8",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_Negation",
"FStar.Map.contains",
"Prims.eq2",
"FStar.Map.sel",
"Prims.logical"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8 | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val is_machine_heap_update : mh: Vale.Arch.MachineHeap_s.machine_heap -> mh': Vale.Arch.MachineHeap_s.machine_heap
-> Prims.logical | [] | Vale.Arch.MachineHeap_s.is_machine_heap_update | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | mh: Vale.Arch.MachineHeap_s.machine_heap -> mh': Vale.Arch.MachineHeap_s.machine_heap
-> Prims.logical | {
"end_col": 62,
"end_line": 19,
"start_col": 2,
"start_line": 17
} |
|
Prims.Tot | val valid_addr (ptr: int) (mem: machine_heap) : bool | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_addr (ptr:int) (mem:machine_heap) : bool =
Map.contains mem ptr | val valid_addr (ptr: int) (mem: machine_heap) : bool
let valid_addr (ptr: int) (mem: machine_heap) : bool = | false | null | false | Map.contains mem ptr | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"FStar.Map.contains",
"Vale.Def.Types_s.nat8",
"Prims.bool"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def
let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem
[@"opaque_to_smt"] let update_heap64 = opaque_make update_heap64_def
irreducible let update_heap64_reveal = opaque_revealer (`%update_heap64) update_heap64 update_heap64_def
let update_heap128_def (ptr:int) (v:quad32) (mem:machine_heap) =
let mem = update_heap32 ptr v.lo0 mem in
let mem = update_heap32 (ptr + 4) v.lo1 mem in
let mem = update_heap32 (ptr + 8) v.hi2 mem in
let mem = update_heap32 (ptr + 12) v.hi3 mem in
mem
[@"opaque_to_smt"] let update_heap128 = opaque_make update_heap128_def
irreducible let update_heap128_reveal = opaque_revealer (`%update_heap128) update_heap128 update_heap128_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val valid_addr (ptr: int) (mem: machine_heap) : bool | [] | Vale.Arch.MachineHeap_s.valid_addr | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Prims.bool | {
"end_col": 22,
"end_line": 84,
"start_col": 2,
"start_line": 84
} |
Prims.Tot | val get_heap_val32_def (ptr: int) (mem: machine_heap) : nat32 | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3]) | val get_heap_val32_def (ptr: int) (mem: machine_heap) : nat32
let get_heap_val32_def (ptr: int) (mem: machine_heap) : nat32 = | false | null | false | four_to_nat 8 (Mkfour mem.[ ptr ] mem.[ ptr + 1 ] mem.[ ptr + 2 ] mem.[ ptr + 3 ]) | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Words.Four_s.four_to_nat",
"Vale.Def.Words_s.Mkfour",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Arch.MachineHeap_s.op_String_Access",
"Vale.Def.Types_s.nat8",
"Prims.op_Addition",
"Vale.Def.Types_s.nat32"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i) | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val32_def (ptr: int) (mem: machine_heap) : nat32 | [] | Vale.Arch.MachineHeap_s.get_heap_val32_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat32 | {
"end_col": 18,
"end_line": 27,
"start_col": 2,
"start_line": 22
} |
Prims.Tot | val update_heap32_def (ptr: int) (v: nat32) (mem: machine_heap) : machine_heap | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem | val update_heap32_def (ptr: int) (v: nat32) (mem: machine_heap) : machine_heap
let update_heap32_def (ptr: int) (v: nat32) (mem: machine_heap) : machine_heap = | false | null | false | let v = nat_to_four 8 v in
let mem = mem.[ ptr ] <- v.lo0 in
let mem = mem.[ ptr + 1 ] <- v.lo1 in
let mem = mem.[ ptr + 2 ] <- v.hi2 in
let mem = mem.[ ptr + 3 ] <- v.hi3 in
mem | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Def.Types_s.nat32",
"Vale.Arch.MachineHeap_s.machine_heap",
"FStar.Map.t",
"Vale.Def.Words_s.nat8",
"Vale.Arch.MachineHeap_s.op_String_Assignment",
"Vale.Def.Types_s.nat8",
"Prims.op_Addition",
"Vale.Def.Words_s.__proj__Mkfour__item__hi3",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Def.Words_s.__proj__Mkfour__item__hi2",
"Vale.Def.Words_s.__proj__Mkfour__item__lo1",
"Vale.Def.Words_s.__proj__Mkfour__item__lo0",
"Vale.Def.Words_s.four",
"Vale.Def.Words.Four_s.nat_to_four"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap32_def (ptr: int) (v: nat32) (mem: machine_heap) : machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap32_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> v: Vale.Def.Types_s.nat32 -> mem: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 5,
"end_line": 54,
"start_col": 77,
"start_line": 48
} |
Prims.Tot | val get_heap_val64_def (ptr: int) (mem: machine_heap) : nat64 | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
) | val get_heap_val64_def (ptr: int) (mem: machine_heap) : nat64
let get_heap_val64_def (ptr: int) (mem: machine_heap) : nat64 = | false | null | false | two_to_nat 32
(Mktwo (four_to_nat 8 (Mkfour mem.[ ptr ] mem.[ ptr + 1 ] mem.[ ptr + 2 ] mem.[ ptr + 3 ]))
(four_to_nat 8 (Mkfour mem.[ ptr + 4 ] mem.[ ptr + 5 ] mem.[ ptr + 6 ] mem.[ ptr + 7 ]))) | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Arch.MachineHeap_s.machine_heap",
"Vale.Def.Words.Two_s.two_to_nat",
"Vale.Def.Words_s.Mktwo",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Def.Words.Four_s.four_to_nat",
"Vale.Def.Words_s.Mkfour",
"Vale.Arch.MachineHeap_s.op_String_Access",
"Vale.Def.Types_s.nat8",
"Prims.op_Addition",
"Vale.Def.Types_s.nat64"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val get_heap_val64_def (ptr: int) (mem: machine_heap) : nat64 | [] | Vale.Arch.MachineHeap_s.get_heap_val64_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> mem: Vale.Arch.MachineHeap_s.machine_heap -> Vale.Def.Types_s.nat64 | {
"end_col": 3,
"end_line": 36,
"start_col": 2,
"start_line": 32
} |
Prims.Tot | val update_heap64_def (ptr: int) (v: nat64) (mem: machine_heap) : machine_heap | [
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Two_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let update_heap64_def (ptr:int) (v:nat64) (mem:machine_heap) : machine_heap =
let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ptr] <- lo.lo0 in
let mem = mem.[ptr + 1] <- lo.lo1 in
let mem = mem.[ptr + 2] <- lo.hi2 in
let mem = mem.[ptr + 3] <- lo.hi3 in
let mem = mem.[ptr + 4] <- hi.lo0 in
let mem = mem.[ptr + 5] <- hi.lo1 in
let mem = mem.[ptr + 6] <- hi.hi2 in
let mem = mem.[ptr + 7] <- hi.hi3 in
mem | val update_heap64_def (ptr: int) (v: nat64) (mem: machine_heap) : machine_heap
let update_heap64_def (ptr: int) (v: nat64) (mem: machine_heap) : machine_heap = | false | null | false | let v = nat_to_two 32 v in
let lo = nat_to_four 8 v.lo in
let hi = nat_to_four 8 v.hi in
let mem = mem.[ ptr ] <- lo.lo0 in
let mem = mem.[ ptr + 1 ] <- lo.lo1 in
let mem = mem.[ ptr + 2 ] <- lo.hi2 in
let mem = mem.[ ptr + 3 ] <- lo.hi3 in
let mem = mem.[ ptr + 4 ] <- hi.lo0 in
let mem = mem.[ ptr + 5 ] <- hi.lo1 in
let mem = mem.[ ptr + 6 ] <- hi.hi2 in
let mem = mem.[ ptr + 7 ] <- hi.hi3 in
mem | {
"checked_file": "Vale.Arch.MachineHeap_s.fst.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Words.Two_s.fsti.checked",
"Vale.Def.Words.Four_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.Arch.MachineHeap_s.fst"
} | [
"total"
] | [
"Prims.int",
"Vale.Def.Types_s.nat64",
"Vale.Arch.MachineHeap_s.machine_heap",
"FStar.Map.t",
"Vale.Def.Words_s.nat8",
"Vale.Arch.MachineHeap_s.op_String_Assignment",
"Vale.Def.Types_s.nat8",
"Prims.op_Addition",
"Vale.Def.Words_s.__proj__Mkfour__item__hi3",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Def.Words_s.__proj__Mkfour__item__hi2",
"Vale.Def.Words_s.__proj__Mkfour__item__lo1",
"Vale.Def.Words_s.__proj__Mkfour__item__lo0",
"Vale.Def.Words_s.four",
"Vale.Def.Words.Four_s.nat_to_four",
"Vale.Def.Words_s.__proj__Mktwo__item__hi",
"Vale.Def.Words_s.__proj__Mktwo__item__lo",
"Vale.Def.Words_s.two",
"Vale.Def.Words.Two_s.nat_to_two"
] | [] | module Vale.Arch.MachineHeap_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Words.Two_s
open Vale.Def.Words.Four_s
open Vale.Def.Types_s
unfold let (.[]) = Map.sel
unfold let (.[]<-) = Map.upd
let machine_heap = Map.t int nat8
let is_machine_heap_update (mh mh':machine_heap) =
Set.equal (Map.domain mh) (Map.domain mh') /\
(forall (i:int).{:pattern Map.sel mh i \/ Map.sel mh' i}
not (Map.contains mh i) ==> Map.sel mh i == Map.sel mh' i)
let get_heap_val32_def (ptr:int) (mem:machine_heap) : nat32 =
four_to_nat 8
(Mkfour
mem.[ptr]
mem.[ptr + 1]
mem.[ptr + 2]
mem.[ptr + 3])
[@"opaque_to_smt"] let get_heap_val32 = opaque_make get_heap_val32_def
irreducible let get_heap_val32_reveal = opaque_revealer (`%get_heap_val32) get_heap_val32 get_heap_val32_def
let get_heap_val64_def (ptr:int) (mem:machine_heap) : nat64 =
two_to_nat 32
(Mktwo
(four_to_nat 8 (Mkfour mem.[ptr] mem.[ptr + 1] mem.[ptr + 2] mem.[ptr + 3]))
(four_to_nat 8 (Mkfour mem.[ptr + 4] mem.[ptr + 5] mem.[ptr + 6] mem.[ptr + 7]))
)
[@"opaque_to_smt"] let get_heap_val64 = opaque_make get_heap_val64_def
irreducible let get_heap_val64_reveal = opaque_revealer (`%get_heap_val64) get_heap_val64 get_heap_val64_def
let get_heap_val128_def (ptr:int) (mem:machine_heap) : quad32 = Mkfour
(get_heap_val32 ptr mem)
(get_heap_val32 (ptr + 4) mem)
(get_heap_val32 (ptr + 8) mem)
(get_heap_val32 (ptr + 12) mem)
[@"opaque_to_smt"] let get_heap_val128 = opaque_make get_heap_val128_def
irreducible let get_heap_val128_reveal = opaque_revealer (`%get_heap_val128) get_heap_val128 get_heap_val128_def
let update_heap32_def (ptr:int) (v:nat32) (mem:machine_heap) : machine_heap =
let v = nat_to_four 8 v in
let mem = mem.[ptr] <- v.lo0 in
let mem = mem.[ptr + 1] <- v.lo1 in
let mem = mem.[ptr + 2] <- v.hi2 in
let mem = mem.[ptr + 3] <- v.hi3 in
mem
[@"opaque_to_smt"] let update_heap32 = opaque_make update_heap32_def
irreducible let update_heap32_reveal = opaque_revealer (`%update_heap32) update_heap32 update_heap32_def | false | true | Vale.Arch.MachineHeap_s.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val update_heap64_def (ptr: int) (v: nat64) (mem: machine_heap) : machine_heap | [] | Vale.Arch.MachineHeap_s.update_heap64_def | {
"file_name": "vale/specs/hardware/Vale.Arch.MachineHeap_s.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | ptr: Prims.int -> v: Vale.Def.Types_s.nat64 -> mem: Vale.Arch.MachineHeap_s.machine_heap
-> Vale.Arch.MachineHeap_s.machine_heap | {
"end_col": 5,
"end_line": 70,
"start_col": 77,
"start_line": 58
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Universe",
"short_module": "U"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MHR"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let property (a:Type)
= a -> prop | let property (a: Type) = | false | null | false | a -> prop | {
"checked_file": "Steel.MonotonicReference.fsti.checked",
"dependencies": [
"Steel.Memory.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicReference.fsti"
} | [
"total"
] | [
"Prims.prop"
] | [] | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicReference
open FStar.PCM
open FStar.Ghost
open Steel.FractionalPermission
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
module Preorder = FStar.Preorder
/// A library for Steel references that are monotonic with respect to a user-specified preorder.
/// This library builds on top of Steel.HigherReference, and is specialized to values at universe 1.
/// An abstract datatype for monotonic references
val ref (a:Type u#0) (p:Preorder.preorder a)
: Type u#0
/// The standard points to separation logic predicate
val pts_to_sl (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: slprop u#1
/// Lifting the standard points to predicate to vprop, with a non-informative selector
[@@ __steel_reduce__]
unfold
let pts_to (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: vprop
= to_vprop (pts_to_sl r f v)
/// Allocates a reference with value [x]. We have full permission on the newly
/// allocated reference.
val alloc (#a:Type) (p:Preorder.preorder a) (v:a)
: SteelT (ref a p) emp (fun r -> pts_to r full_perm v)
/// Writes value [x] in the reference [r], as long as we have full ownership of [r]
val write (#a:Type) (#p:Preorder.preorder a) (#v:erased a)
(r:ref a p) (x:a)
: Steel unit (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
/// A wrapper around a predicate that depends on a value of type [a] | false | true | Steel.MonotonicReference.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val property : a: Type -> Type | [] | Steel.MonotonicReference.property | {
"file_name": "lib/steel/Steel.MonotonicReference.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | a: Type -> Type | {
"end_col": 13,
"end_line": 70,
"start_col": 4,
"start_line": 70
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Universe",
"short_module": "U"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MHR"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let stable_property (#a:Type) (p:Preorder.preorder a)
= fact:property a { Preorder.stable fact p } | let stable_property (#a: Type) (p: Preorder.preorder a) = | false | null | false | fact: property a {Preorder.stable fact p} | {
"checked_file": "Steel.MonotonicReference.fsti.checked",
"dependencies": [
"Steel.Memory.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicReference.fsti"
} | [
"total"
] | [
"FStar.Preorder.preorder",
"Steel.MonotonicReference.property",
"FStar.Preorder.stable"
] | [] | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicReference
open FStar.PCM
open FStar.Ghost
open Steel.FractionalPermission
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
module Preorder = FStar.Preorder
/// A library for Steel references that are monotonic with respect to a user-specified preorder.
/// This library builds on top of Steel.HigherReference, and is specialized to values at universe 1.
/// An abstract datatype for monotonic references
val ref (a:Type u#0) (p:Preorder.preorder a)
: Type u#0
/// The standard points to separation logic predicate
val pts_to_sl (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: slprop u#1
/// Lifting the standard points to predicate to vprop, with a non-informative selector
[@@ __steel_reduce__]
unfold
let pts_to (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: vprop
= to_vprop (pts_to_sl r f v)
/// Allocates a reference with value [x]. We have full permission on the newly
/// allocated reference.
val alloc (#a:Type) (p:Preorder.preorder a) (v:a)
: SteelT (ref a p) emp (fun r -> pts_to r full_perm v)
/// Writes value [x] in the reference [r], as long as we have full ownership of [r]
val write (#a:Type) (#p:Preorder.preorder a) (#v:erased a)
(r:ref a p) (x:a)
: Steel unit (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
/// A wrapper around a predicate that depends on a value of type [a]
let property (a:Type)
= a -> prop
/// A wrapper around a property [fact] that has been witnessed to be true and stable
/// with respect to preorder [p]
val witnessed (#a:Type u#0) (#p:Preorder.preorder a) (r:ref a p) (fact:property a)
: Type0
/// The type of properties depending on values of type [a], and that
/// are stable with respect to the preorder [p] | false | false | Steel.MonotonicReference.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val stable_property : p: FStar.Preorder.preorder a -> Type | [] | Steel.MonotonicReference.stable_property | {
"file_name": "lib/steel/Steel.MonotonicReference.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.Preorder.preorder a -> Type | {
"end_col": 46,
"end_line": 80,
"start_col": 4,
"start_line": 80
} |
|
Prims.Tot | val pts_to (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a) : vprop | [
{
"abbrev": true,
"full_module": "FStar.Universe",
"short_module": "U"
},
{
"abbrev": true,
"full_module": "Steel.MonotonicHigherReference",
"short_module": "MHR"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pts_to (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: vprop
= to_vprop (pts_to_sl r f v) | val pts_to (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a) : vprop
let pts_to (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a) : vprop = | false | null | false | to_vprop (pts_to_sl r f v) | {
"checked_file": "Steel.MonotonicReference.fsti.checked",
"dependencies": [
"Steel.Memory.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicReference.fsti"
} | [
"total"
] | [
"FStar.Preorder.preorder",
"Steel.MonotonicReference.ref",
"Steel.FractionalPermission.perm",
"Steel.Effect.Common.to_vprop",
"Steel.MonotonicReference.pts_to_sl",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicReference
open FStar.PCM
open FStar.Ghost
open Steel.FractionalPermission
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
module Preorder = FStar.Preorder
/// A library for Steel references that are monotonic with respect to a user-specified preorder.
/// This library builds on top of Steel.HigherReference, and is specialized to values at universe 1.
/// An abstract datatype for monotonic references
val ref (a:Type u#0) (p:Preorder.preorder a)
: Type u#0
/// The standard points to separation logic predicate
val pts_to_sl (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: slprop u#1
/// Lifting the standard points to predicate to vprop, with a non-informative selector
[@@ __steel_reduce__]
unfold
let pts_to (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a) | false | false | Steel.MonotonicReference.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pts_to (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a) : vprop | [] | Steel.MonotonicReference.pts_to | {
"file_name": "lib/steel/Steel.MonotonicReference.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.MonotonicReference.ref a p -> f: Steel.FractionalPermission.perm -> v: a
-> Steel.Effect.Common.vprop | {
"end_col": 31,
"end_line": 53,
"start_col": 5,
"start_line": 53
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m) | let row_p (a: Spec.alg) (m: m_spec) = | false | null | false | lbuffer (element_t a m) (row_len a m) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"Lib.Buffer.lbuffer",
"Hacl.Impl.Blake2.Core.element_t",
"Hacl.Impl.Blake2.Core.row_len"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val row_p : a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | [] | Hacl.Impl.Blake2.Core.row_p | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | {
"end_col": 39,
"end_line": 45,
"start_col": 2,
"start_line": 45
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let index_t = n:size_t{v n < 4} | let index_t = | false | null | false | n: size_t{v n < 4} | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m) | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val index_t : Type0 | [] | Hacl.Impl.Blake2.Core.index_t | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 38,
"end_line": 61,
"start_col": 21,
"start_line": 61
} |
|
Prims.Tot | val row_len (a: Spec.alg) (m: m_spec) : size_t | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul | val row_len (a: Spec.alg) (m: m_spec) : size_t
let row_len (a: Spec.alg) (m: m_spec) : size_t = | false | null | false | match a, m with
| Spec.Blake2S, M128 -> 1ul
| Spec.Blake2S, M256 -> 1ul
| Spec.Blake2B, M256 -> 1ul
| _ -> 4ul | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"FStar.Pervasives.Native.Mktuple2",
"FStar.UInt32.__uint_to_t",
"FStar.Pervasives.Native.tuple2",
"Lib.IntTypes.size_t"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val row_len (a: Spec.alg) (m: m_spec) : size_t | [] | Hacl.Impl.Blake2.Core.row_len | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Lib.IntTypes.size_t | {
"end_col": 12,
"end_line": 41,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let store_state_st (a: Spec.alg) (m: m_spec) =
st32:state_p a M32 -> st:state_p a m ->
Stack unit
(requires (fun h -> live h st /\ live h st32 /\ disjoint st st32))
(ensures (fun h0 _ h1 -> modifies (loc st32) h0 h1 /\
state_v h1 st32 == state_v h0 st)) | let store_state_st (a: Spec.alg) (m: m_spec) = | false | null | false | st32: state_p a M32 -> st: state_p a m
-> Stack unit
(requires (fun h -> live h st /\ live h st32 /\ disjoint st st32))
(ensures (fun h0 _ h1 -> modifies (loc st32) h0 h1 /\ state_v h1 st32 == state_v h0 st)) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"Hacl.Impl.Blake2.Core.state_p",
"Hacl.Impl.Blake2.Core.M32",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"Prims.l_and",
"Lib.Buffer.live",
"Lib.Buffer.MUT",
"Hacl.Impl.Blake2.Core.element_t",
"Lib.Buffer.disjoint",
"Lib.Buffer.modifies",
"Lib.Buffer.loc",
"Prims.eq2",
"Spec.Blake2.state",
"Hacl.Impl.Blake2.Core.state_v"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m)
noextract inline_for_extraction
unfold let index_t = n:size_t{v n < 4}
noextract inline_for_extraction
let g_rowi (#a:Spec.alg) (#m:m_spec) (st:state_p a m) (idx:index_t) : GTot (row_p a m) =
gsub st (idx *. row_len a m) (row_len a m)
val g_rowi_disjoint: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx1:index_t -> idx2:index_t ->
Lemma (ensures (v idx1 <> v idx2 ==> disjoint (g_rowi st idx1) (g_rowi st idx2)))
[SMTPat (disjoint (g_rowi st idx1) (g_rowi st idx2))]
val g_rowi_unchanged: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (as_seq h0 st == as_seq h1 st))
(ensures (as_seq h0 (g_rowi st i) == as_seq h1 (g_rowi st i)))
[SMTPat (as_seq h0 (g_rowi st i)); SMTPat (as_seq h1 (g_rowi st i))]
val g_rowi_disjoint_other: #a:Spec.alg -> #m:m_spec -> #b:Type -> st:state_p a m -> i:index_t -> x:buffer b ->
Lemma(requires (disjoint st x))
(ensures (disjoint (g_rowi st i) x))
[SMTPat (disjoint (g_rowi st i) x)]
inline_for_extraction noextract
val state_v: #a:Spec.alg -> #m:m_spec -> mem -> state_p a m -> GTot (Spec.state a)
noextract
val state_v_eq_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st1:state_p a m -> st2:state_p a m ->
Lemma (requires (as_seq h0 st1 == as_seq h1 st2))
(ensures (state_v h0 st1 == state_v h1 st2))
[SMTPat (state_v #a #m h0 st1); SMTPat (state_v #a #m h1 st2)]
noextract
val state_v_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (Lib.Sequence.((state_v h st).[v i] == row_v h (g_rowi st i))))
[SMTPat (row_v h (g_rowi st i))]
noextract
val state_v_live_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (live h (g_rowi st i)))
[SMTPat (live h (g_rowi st i))]
noextract
val modifies_one_row: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t -> j:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1 /\ v i <> v j))
(ensures (row_v h1 (g_rowi st j) == row_v h0 (g_rowi st j)))
[SMTPat (modifies (loc (g_rowi st i)) h0 h1); SMTPat (row_v h1 (g_rowi st j))]
noextract
val modifies_row_state: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1))
(ensures (modifies (loc st) h0 h1 /\
state_v h1 st == Lib.Sequence.((state_v h0 st).[v i] <- row_v h1 (g_rowi st i))))
[SMTPat (modifies (loc (g_rowi #a #m st i)) h0 h1)]
noextract inline_for_extraction
val rowi: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx:index_t ->
Stack (row_p a m)
(requires (fun h -> live h st))
(ensures (fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == g_rowi st idx))
noextract inline_for_extraction
val xor_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 ^| row_v h0 r2 )))
noextract inline_for_extraction
val add_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 +| row_v h0 r2 )))
noextract inline_for_extraction
val ror_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:rotval (Spec.wt a) ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 >>>| r2 )))
noextract inline_for_extraction
val permr_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> n:index_t ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( rotr (row_v h0 r1) (v n) )))
val create4_lemma: #a:Type -> x0:a -> x1:a -> x2:a -> x3:a ->
Lemma (ensures (
let l = [ x0; x1; x2; x3 ] in
assert_norm (List.Tot.length l = 4);
Lib.Sequence.createL l == Lib.Sequence.create4 x0 x1 x2 x3))
[SMTPat (Lib.Sequence.createL [x0;x1;x2;x3])]
noextract inline_for_extraction
val alloc_row: a:Spec.alg -> m:m_spec ->
StackInline (row_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (v (row_len a m)) (zero_element a m)) /\
live h1 r /\
row_v h1 r == Spec.zero_row a))
noextract inline_for_extraction
val create_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> w0:word_t a -> w1:word_t a -> w2:word_t a -> w3:word_t a ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( create_row w0 w1 w2 w3 )))
noextract inline_for_extraction
val load_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> ws:lbuffer (word_t a) 4ul ->
Stack unit
(requires (fun h -> live h r1 /\ live h ws /\ disjoint r1 ws))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( load_row (as_seq h0 ws))))
noextract inline_for_extraction
let size_row al = 4ul *. size (Spec.size_word al)
noextract inline_for_extraction
val store_row: #a:Spec.alg -> #m:m_spec -> b:lbuffer uint8 (size_row a) -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
as_seq h1 b == Lib.ByteSequence.uints_to_bytes_le (row_v h0 r)))
noextract inline_for_extraction
val store_row32: #a:Spec.alg -> #m:m_spec -> b:lbuffer (word_t a) 4ul -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
Spec.( load_row (as_seq h1 b)) == row_v h0 r))
noextract inline_for_extraction
let size_block (a:Spec.alg) : x:size_t{v x = 16 * Spec.size_word a} =
Spec.alg_inversion_lemma a;
match a with
| Spec.Blake2.Blake2S -> 64ul
| Spec.Blake2.Blake2B -> 128ul
noextract inline_for_extraction
type block_p (a:Spec.alg) = lbuffer uint8 (size_block a)
noextract inline_for_extraction
type block_w (a:Spec.alg) = lbuffer (word_t a) 16ul
noextract inline_for_extraction
val gather_row: #a:Spec.alg -> #ms:m_spec -> r:row_p a ms -> m:block_w a ->
i0: Spec.sigma_elt_t -> i1:Spec.sigma_elt_t -> i2:Spec.sigma_elt_t -> i3:Spec.sigma_elt_t
-> Stack unit
(requires (fun h -> live h r /\ live h m /\ disjoint r m))
(ensures (fun h0 _ h1 -> modifies (loc r) h0 h1 /\
row_v h1 r == Spec.(gather_row (as_seq h0 m) i0 i1 i2 i3)))
noextract inline_for_extraction
val le_sigh (a:Spec.alg) (m:m_spec): x:size_t { x == 4ul *. row_len a m }
noextract inline_for_extraction
val alloc_state: a:Spec.alg -> m:m_spec ->
StackInline (state_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (4 * v (row_len a m)) (zero_element a m)) /\
live h1 r))
noextract inline_for_extraction
val copy_state: #a:Spec.alg -> #m:m_spec -> st2:state_p a m -> st1:state_p a m ->
Stack unit
(requires (fun h0 -> live h0 st1 /\ live h0 st2 /\ disjoint st1 st2))
(ensures (fun h0 r h1 -> modifies (loc st2) h0 h1 /\
state_v h1 st2 == state_v h0 st1))
noextract inline_for_extraction
let load_state_st (a: Spec.alg) (m: m_spec) =
st:state_p a m -> st32:state_p a M32 ->
Stack unit
(requires (fun h -> live h st /\ live h st32 /\ disjoint st st32))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
state_v h1 st == state_v h0 st32))
noextract inline_for_extraction
val load_state_from_state32: #a:Spec.alg -> #m:m_spec -> load_state_st a m
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val store_state_st : a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | [] | Hacl.Impl.Blake2.Core.store_state_st | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | {
"end_col": 38,
"end_line": 250,
"start_col": 2,
"start_line": 246
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_state_st (a: Spec.alg) (m: m_spec) =
st:state_p a m -> st32:state_p a M32 ->
Stack unit
(requires (fun h -> live h st /\ live h st32 /\ disjoint st st32))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
state_v h1 st == state_v h0 st32)) | let load_state_st (a: Spec.alg) (m: m_spec) = | false | null | false | st: state_p a m -> st32: state_p a M32
-> Stack unit
(requires (fun h -> live h st /\ live h st32 /\ disjoint st st32))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ state_v h1 st == state_v h0 st32)) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"Hacl.Impl.Blake2.Core.state_p",
"Hacl.Impl.Blake2.Core.M32",
"Prims.unit",
"FStar.Monotonic.HyperStack.mem",
"Prims.l_and",
"Lib.Buffer.live",
"Lib.Buffer.MUT",
"Hacl.Impl.Blake2.Core.element_t",
"Lib.Buffer.disjoint",
"Lib.Buffer.modifies",
"Lib.Buffer.loc",
"Prims.eq2",
"Spec.Blake2.state",
"Hacl.Impl.Blake2.Core.state_v"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m)
noextract inline_for_extraction
unfold let index_t = n:size_t{v n < 4}
noextract inline_for_extraction
let g_rowi (#a:Spec.alg) (#m:m_spec) (st:state_p a m) (idx:index_t) : GTot (row_p a m) =
gsub st (idx *. row_len a m) (row_len a m)
val g_rowi_disjoint: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx1:index_t -> idx2:index_t ->
Lemma (ensures (v idx1 <> v idx2 ==> disjoint (g_rowi st idx1) (g_rowi st idx2)))
[SMTPat (disjoint (g_rowi st idx1) (g_rowi st idx2))]
val g_rowi_unchanged: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (as_seq h0 st == as_seq h1 st))
(ensures (as_seq h0 (g_rowi st i) == as_seq h1 (g_rowi st i)))
[SMTPat (as_seq h0 (g_rowi st i)); SMTPat (as_seq h1 (g_rowi st i))]
val g_rowi_disjoint_other: #a:Spec.alg -> #m:m_spec -> #b:Type -> st:state_p a m -> i:index_t -> x:buffer b ->
Lemma(requires (disjoint st x))
(ensures (disjoint (g_rowi st i) x))
[SMTPat (disjoint (g_rowi st i) x)]
inline_for_extraction noextract
val state_v: #a:Spec.alg -> #m:m_spec -> mem -> state_p a m -> GTot (Spec.state a)
noextract
val state_v_eq_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st1:state_p a m -> st2:state_p a m ->
Lemma (requires (as_seq h0 st1 == as_seq h1 st2))
(ensures (state_v h0 st1 == state_v h1 st2))
[SMTPat (state_v #a #m h0 st1); SMTPat (state_v #a #m h1 st2)]
noextract
val state_v_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (Lib.Sequence.((state_v h st).[v i] == row_v h (g_rowi st i))))
[SMTPat (row_v h (g_rowi st i))]
noextract
val state_v_live_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (live h (g_rowi st i)))
[SMTPat (live h (g_rowi st i))]
noextract
val modifies_one_row: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t -> j:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1 /\ v i <> v j))
(ensures (row_v h1 (g_rowi st j) == row_v h0 (g_rowi st j)))
[SMTPat (modifies (loc (g_rowi st i)) h0 h1); SMTPat (row_v h1 (g_rowi st j))]
noextract
val modifies_row_state: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1))
(ensures (modifies (loc st) h0 h1 /\
state_v h1 st == Lib.Sequence.((state_v h0 st).[v i] <- row_v h1 (g_rowi st i))))
[SMTPat (modifies (loc (g_rowi #a #m st i)) h0 h1)]
noextract inline_for_extraction
val rowi: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx:index_t ->
Stack (row_p a m)
(requires (fun h -> live h st))
(ensures (fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == g_rowi st idx))
noextract inline_for_extraction
val xor_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 ^| row_v h0 r2 )))
noextract inline_for_extraction
val add_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 +| row_v h0 r2 )))
noextract inline_for_extraction
val ror_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:rotval (Spec.wt a) ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 >>>| r2 )))
noextract inline_for_extraction
val permr_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> n:index_t ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( rotr (row_v h0 r1) (v n) )))
val create4_lemma: #a:Type -> x0:a -> x1:a -> x2:a -> x3:a ->
Lemma (ensures (
let l = [ x0; x1; x2; x3 ] in
assert_norm (List.Tot.length l = 4);
Lib.Sequence.createL l == Lib.Sequence.create4 x0 x1 x2 x3))
[SMTPat (Lib.Sequence.createL [x0;x1;x2;x3])]
noextract inline_for_extraction
val alloc_row: a:Spec.alg -> m:m_spec ->
StackInline (row_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (v (row_len a m)) (zero_element a m)) /\
live h1 r /\
row_v h1 r == Spec.zero_row a))
noextract inline_for_extraction
val create_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> w0:word_t a -> w1:word_t a -> w2:word_t a -> w3:word_t a ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( create_row w0 w1 w2 w3 )))
noextract inline_for_extraction
val load_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> ws:lbuffer (word_t a) 4ul ->
Stack unit
(requires (fun h -> live h r1 /\ live h ws /\ disjoint r1 ws))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( load_row (as_seq h0 ws))))
noextract inline_for_extraction
let size_row al = 4ul *. size (Spec.size_word al)
noextract inline_for_extraction
val store_row: #a:Spec.alg -> #m:m_spec -> b:lbuffer uint8 (size_row a) -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
as_seq h1 b == Lib.ByteSequence.uints_to_bytes_le (row_v h0 r)))
noextract inline_for_extraction
val store_row32: #a:Spec.alg -> #m:m_spec -> b:lbuffer (word_t a) 4ul -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
Spec.( load_row (as_seq h1 b)) == row_v h0 r))
noextract inline_for_extraction
let size_block (a:Spec.alg) : x:size_t{v x = 16 * Spec.size_word a} =
Spec.alg_inversion_lemma a;
match a with
| Spec.Blake2.Blake2S -> 64ul
| Spec.Blake2.Blake2B -> 128ul
noextract inline_for_extraction
type block_p (a:Spec.alg) = lbuffer uint8 (size_block a)
noextract inline_for_extraction
type block_w (a:Spec.alg) = lbuffer (word_t a) 16ul
noextract inline_for_extraction
val gather_row: #a:Spec.alg -> #ms:m_spec -> r:row_p a ms -> m:block_w a ->
i0: Spec.sigma_elt_t -> i1:Spec.sigma_elt_t -> i2:Spec.sigma_elt_t -> i3:Spec.sigma_elt_t
-> Stack unit
(requires (fun h -> live h r /\ live h m /\ disjoint r m))
(ensures (fun h0 _ h1 -> modifies (loc r) h0 h1 /\
row_v h1 r == Spec.(gather_row (as_seq h0 m) i0 i1 i2 i3)))
noextract inline_for_extraction
val le_sigh (a:Spec.alg) (m:m_spec): x:size_t { x == 4ul *. row_len a m }
noextract inline_for_extraction
val alloc_state: a:Spec.alg -> m:m_spec ->
StackInline (state_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (4 * v (row_len a m)) (zero_element a m)) /\
live h1 r))
noextract inline_for_extraction
val copy_state: #a:Spec.alg -> #m:m_spec -> st2:state_p a m -> st1:state_p a m ->
Stack unit
(requires (fun h0 -> live h0 st1 /\ live h0 st2 /\ disjoint st1 st2))
(ensures (fun h0 r h1 -> modifies (loc st2) h0 h1 /\
state_v h1 st2 == state_v h0 st1))
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_state_st : a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | [] | Hacl.Impl.Blake2.Core.load_state_st | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | {
"end_col": 38,
"end_line": 239,
"start_col": 2,
"start_line": 235
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m) | let state_p (a: Spec.alg) (m: m_spec) = | false | null | false | lbuffer (element_t a m) (4ul *. row_len a m) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"Lib.Buffer.lbuffer",
"Hacl.Impl.Blake2.Core.element_t",
"Lib.IntTypes.op_Star_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Blake2.Core.row_len"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val state_p : a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | [] | Hacl.Impl.Blake2.Core.state_p | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | {
"end_col": 46,
"end_line": 58,
"start_col": 2,
"start_line": 58
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let size_row al = 4ul *. size (Spec.size_word al) | let size_row al = | false | null | false | 4ul *. size (Spec.size_word al) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Lib.IntTypes.op_Star_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size",
"Spec.Blake2.size_word",
"Lib.IntTypes.int_t"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m)
noextract inline_for_extraction
unfold let index_t = n:size_t{v n < 4}
noextract inline_for_extraction
let g_rowi (#a:Spec.alg) (#m:m_spec) (st:state_p a m) (idx:index_t) : GTot (row_p a m) =
gsub st (idx *. row_len a m) (row_len a m)
val g_rowi_disjoint: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx1:index_t -> idx2:index_t ->
Lemma (ensures (v idx1 <> v idx2 ==> disjoint (g_rowi st idx1) (g_rowi st idx2)))
[SMTPat (disjoint (g_rowi st idx1) (g_rowi st idx2))]
val g_rowi_unchanged: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (as_seq h0 st == as_seq h1 st))
(ensures (as_seq h0 (g_rowi st i) == as_seq h1 (g_rowi st i)))
[SMTPat (as_seq h0 (g_rowi st i)); SMTPat (as_seq h1 (g_rowi st i))]
val g_rowi_disjoint_other: #a:Spec.alg -> #m:m_spec -> #b:Type -> st:state_p a m -> i:index_t -> x:buffer b ->
Lemma(requires (disjoint st x))
(ensures (disjoint (g_rowi st i) x))
[SMTPat (disjoint (g_rowi st i) x)]
inline_for_extraction noextract
val state_v: #a:Spec.alg -> #m:m_spec -> mem -> state_p a m -> GTot (Spec.state a)
noextract
val state_v_eq_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st1:state_p a m -> st2:state_p a m ->
Lemma (requires (as_seq h0 st1 == as_seq h1 st2))
(ensures (state_v h0 st1 == state_v h1 st2))
[SMTPat (state_v #a #m h0 st1); SMTPat (state_v #a #m h1 st2)]
noextract
val state_v_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (Lib.Sequence.((state_v h st).[v i] == row_v h (g_rowi st i))))
[SMTPat (row_v h (g_rowi st i))]
noextract
val state_v_live_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (live h (g_rowi st i)))
[SMTPat (live h (g_rowi st i))]
noextract
val modifies_one_row: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t -> j:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1 /\ v i <> v j))
(ensures (row_v h1 (g_rowi st j) == row_v h0 (g_rowi st j)))
[SMTPat (modifies (loc (g_rowi st i)) h0 h1); SMTPat (row_v h1 (g_rowi st j))]
noextract
val modifies_row_state: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1))
(ensures (modifies (loc st) h0 h1 /\
state_v h1 st == Lib.Sequence.((state_v h0 st).[v i] <- row_v h1 (g_rowi st i))))
[SMTPat (modifies (loc (g_rowi #a #m st i)) h0 h1)]
noextract inline_for_extraction
val rowi: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx:index_t ->
Stack (row_p a m)
(requires (fun h -> live h st))
(ensures (fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == g_rowi st idx))
noextract inline_for_extraction
val xor_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 ^| row_v h0 r2 )))
noextract inline_for_extraction
val add_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 +| row_v h0 r2 )))
noextract inline_for_extraction
val ror_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:rotval (Spec.wt a) ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 >>>| r2 )))
noextract inline_for_extraction
val permr_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> n:index_t ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( rotr (row_v h0 r1) (v n) )))
val create4_lemma: #a:Type -> x0:a -> x1:a -> x2:a -> x3:a ->
Lemma (ensures (
let l = [ x0; x1; x2; x3 ] in
assert_norm (List.Tot.length l = 4);
Lib.Sequence.createL l == Lib.Sequence.create4 x0 x1 x2 x3))
[SMTPat (Lib.Sequence.createL [x0;x1;x2;x3])]
noextract inline_for_extraction
val alloc_row: a:Spec.alg -> m:m_spec ->
StackInline (row_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (v (row_len a m)) (zero_element a m)) /\
live h1 r /\
row_v h1 r == Spec.zero_row a))
noextract inline_for_extraction
val create_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> w0:word_t a -> w1:word_t a -> w2:word_t a -> w3:word_t a ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( create_row w0 w1 w2 w3 )))
noextract inline_for_extraction
val load_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> ws:lbuffer (word_t a) 4ul ->
Stack unit
(requires (fun h -> live h r1 /\ live h ws /\ disjoint r1 ws))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( load_row (as_seq h0 ws)))) | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val size_row : al: Spec.Blake2.alg -> Lib.IntTypes.int_t Lib.IntTypes.U32 Lib.IntTypes.PUB | [] | Hacl.Impl.Blake2.Core.size_row | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | al: Spec.Blake2.alg -> Lib.IntTypes.int_t Lib.IntTypes.U32 Lib.IntTypes.PUB | {
"end_col": 49,
"end_line": 177,
"start_col": 18,
"start_line": 177
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a) | let element_t (a: Spec.alg) (m: m_spec) = | false | null | false | match a, m with
| Spec.Blake2S, M128 -> (vec_t U32 4)
| Spec.Blake2S, M256 -> (vec_t U32 4)
| Spec.Blake2B, M256 -> (vec_t U64 4)
| _ -> (word_t a) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"FStar.Pervasives.Native.Mktuple2",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U32",
"Lib.IntTypes.U64",
"FStar.Pervasives.Native.tuple2",
"Hacl.Impl.Blake2.Core.word_t"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction | false | true | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val element_t : a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | [] | Hacl.Impl.Blake2.Core.element_t | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> m: Hacl.Impl.Blake2.Core.m_spec -> Type0 | {
"end_col": 19,
"end_line": 30,
"start_col": 2,
"start_line": 26
} |
|
Prims.Tot | val size_block (a: Spec.alg) : x: size_t{v x = 16 * Spec.size_word a} | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let size_block (a:Spec.alg) : x:size_t{v x = 16 * Spec.size_word a} =
Spec.alg_inversion_lemma a;
match a with
| Spec.Blake2.Blake2S -> 64ul
| Spec.Blake2.Blake2B -> 128ul | val size_block (a: Spec.alg) : x: size_t{v x = 16 * Spec.size_word a}
let size_block (a: Spec.alg) : x: size_t{v x = 16 * Spec.size_word a} = | false | null | false | Spec.alg_inversion_lemma a;
match a with
| Spec.Blake2.Blake2S -> 64ul
| Spec.Blake2.Blake2B -> 128ul | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"total"
] | [
"Spec.Blake2.alg",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.Mul.op_Star",
"Spec.Blake2.size_word",
"Prims.unit",
"Spec.Blake2.alg_inversion_lemma"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m)
noextract inline_for_extraction
unfold let index_t = n:size_t{v n < 4}
noextract inline_for_extraction
let g_rowi (#a:Spec.alg) (#m:m_spec) (st:state_p a m) (idx:index_t) : GTot (row_p a m) =
gsub st (idx *. row_len a m) (row_len a m)
val g_rowi_disjoint: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx1:index_t -> idx2:index_t ->
Lemma (ensures (v idx1 <> v idx2 ==> disjoint (g_rowi st idx1) (g_rowi st idx2)))
[SMTPat (disjoint (g_rowi st idx1) (g_rowi st idx2))]
val g_rowi_unchanged: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (as_seq h0 st == as_seq h1 st))
(ensures (as_seq h0 (g_rowi st i) == as_seq h1 (g_rowi st i)))
[SMTPat (as_seq h0 (g_rowi st i)); SMTPat (as_seq h1 (g_rowi st i))]
val g_rowi_disjoint_other: #a:Spec.alg -> #m:m_spec -> #b:Type -> st:state_p a m -> i:index_t -> x:buffer b ->
Lemma(requires (disjoint st x))
(ensures (disjoint (g_rowi st i) x))
[SMTPat (disjoint (g_rowi st i) x)]
inline_for_extraction noextract
val state_v: #a:Spec.alg -> #m:m_spec -> mem -> state_p a m -> GTot (Spec.state a)
noextract
val state_v_eq_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> st1:state_p a m -> st2:state_p a m ->
Lemma (requires (as_seq h0 st1 == as_seq h1 st2))
(ensures (state_v h0 st1 == state_v h1 st2))
[SMTPat (state_v #a #m h0 st1); SMTPat (state_v #a #m h1 st2)]
noextract
val state_v_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (Lib.Sequence.((state_v h st).[v i] == row_v h (g_rowi st i))))
[SMTPat (row_v h (g_rowi st i))]
noextract
val state_v_live_rowi_lemma: #a:Spec.alg -> #m:m_spec -> h:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h st))
(ensures (live h (g_rowi st i)))
[SMTPat (live h (g_rowi st i))]
noextract
val modifies_one_row: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t -> j:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1 /\ v i <> v j))
(ensures (row_v h1 (g_rowi st j) == row_v h0 (g_rowi st j)))
[SMTPat (modifies (loc (g_rowi st i)) h0 h1); SMTPat (row_v h1 (g_rowi st j))]
noextract
val modifies_row_state: a:Spec.alg -> m:m_spec -> h0:mem -> h1:mem -> st:state_p a m -> i:index_t ->
Lemma (requires (live h0 st /\ modifies (loc (g_rowi st i)) h0 h1))
(ensures (modifies (loc st) h0 h1 /\
state_v h1 st == Lib.Sequence.((state_v h0 st).[v i] <- row_v h1 (g_rowi st i))))
[SMTPat (modifies (loc (g_rowi #a #m st i)) h0 h1)]
noextract inline_for_extraction
val rowi: #a:Spec.alg -> #m:m_spec -> st:state_p a m -> idx:index_t ->
Stack (row_p a m)
(requires (fun h -> live h st))
(ensures (fun h0 r h1 -> h0 == h1 /\ live h1 r /\ r == g_rowi st idx))
noextract inline_for_extraction
val xor_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 ^| row_v h0 r2 )))
noextract inline_for_extraction
val add_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:row_p a m ->
Stack unit
(requires (fun h -> live h r1 /\ live h r2 /\ disjoint r1 r2))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 +| row_v h0 r2 )))
noextract inline_for_extraction
val ror_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> r2:rotval (Spec.wt a) ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( row_v h0 r1 >>>| r2 )))
noextract inline_for_extraction
val permr_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> n:index_t ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( rotr (row_v h0 r1) (v n) )))
val create4_lemma: #a:Type -> x0:a -> x1:a -> x2:a -> x3:a ->
Lemma (ensures (
let l = [ x0; x1; x2; x3 ] in
assert_norm (List.Tot.length l = 4);
Lib.Sequence.createL l == Lib.Sequence.create4 x0 x1 x2 x3))
[SMTPat (Lib.Sequence.createL [x0;x1;x2;x3])]
noextract inline_for_extraction
val alloc_row: a:Spec.alg -> m:m_spec ->
StackInline (row_p a m)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> stack_allocated r h0 h1 (Lib.Sequence.create (v (row_len a m)) (zero_element a m)) /\
live h1 r /\
row_v h1 r == Spec.zero_row a))
noextract inline_for_extraction
val create_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> w0:word_t a -> w1:word_t a -> w2:word_t a -> w3:word_t a ->
Stack unit
(requires (fun h -> live h r1))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( create_row w0 w1 w2 w3 )))
noextract inline_for_extraction
val load_row: #a:Spec.alg -> #m:m_spec -> r1:row_p a m -> ws:lbuffer (word_t a) 4ul ->
Stack unit
(requires (fun h -> live h r1 /\ live h ws /\ disjoint r1 ws))
(ensures (fun h0 _ h1 -> modifies (loc r1) h0 h1 /\
row_v h1 r1 == Spec.( load_row (as_seq h0 ws))))
noextract inline_for_extraction
let size_row al = 4ul *. size (Spec.size_word al)
noextract inline_for_extraction
val store_row: #a:Spec.alg -> #m:m_spec -> b:lbuffer uint8 (size_row a) -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
as_seq h1 b == Lib.ByteSequence.uints_to_bytes_le (row_v h0 r)))
noextract inline_for_extraction
val store_row32: #a:Spec.alg -> #m:m_spec -> b:lbuffer (word_t a) 4ul -> r:row_p a m ->
Stack unit
(requires (fun h -> live h r /\ live h b /\ disjoint r b))
(ensures (fun h0 _ h1 -> modifies (loc b) h0 h1 /\
Spec.( load_row (as_seq h1 b)) == row_v h0 r))
noextract inline_for_extraction | false | false | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val size_block (a: Spec.alg) : x: size_t{v x = 16 * Spec.size_word a} | [] | Hacl.Impl.Blake2.Core.size_block | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Blake2.alg -> x: Lib.IntTypes.size_t{Lib.IntTypes.v x = 16 * Spec.Blake2.size_word a} | {
"end_col": 32,
"end_line": 198,
"start_col": 2,
"start_line": 195
} |
Prims.GTot | val g_rowi (#a: Spec.alg) (#m: m_spec) (st: state_p a m) (idx: index_t) : GTot (row_p a m) | [
{
"abbrev": true,
"full_module": "Spec.Blake2",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Blake2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let g_rowi (#a:Spec.alg) (#m:m_spec) (st:state_p a m) (idx:index_t) : GTot (row_p a m) =
gsub st (idx *. row_len a m) (row_len a m) | val g_rowi (#a: Spec.alg) (#m: m_spec) (st: state_p a m) (idx: index_t) : GTot (row_p a m)
let g_rowi (#a: Spec.alg) (#m: m_spec) (st: state_p a m) (idx: index_t) : GTot (row_p a m) = | false | null | false | gsub st (idx *. row_len a m) (row_len a m) | {
"checked_file": "Hacl.Impl.Blake2.Core.fsti.checked",
"dependencies": [
"Spec.Blake2.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Blake2.Core.fsti"
} | [
"sometrivial"
] | [
"Spec.Blake2.alg",
"Hacl.Impl.Blake2.Core.m_spec",
"Hacl.Impl.Blake2.Core.state_p",
"Hacl.Impl.Blake2.Core.index_t",
"Lib.Buffer.gsub",
"Lib.Buffer.MUT",
"Hacl.Impl.Blake2.Core.element_t",
"Lib.IntTypes.op_Star_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"FStar.UInt32.__uint_to_t",
"Hacl.Impl.Blake2.Core.row_len",
"Hacl.Impl.Blake2.Core.row_p"
] | [] | module Hacl.Impl.Blake2.Core
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Spec.Blake2
#set-options "--max_fuel 0 --max_ifuel 1"
type m_spec =
| M32
| M128
| M256
noextract inline_for_extraction
type word_t (a:Spec.alg) = Spec.word_t a
noextract inline_for_extraction
let element_t (a:Spec.alg) (m:m_spec) =
match a,m with
| Spec.Blake2S,M128 -> (vec_t U32 4)
| Spec.Blake2S,M256 -> (vec_t U32 4)
| Spec.Blake2B,M256 -> (vec_t U64 4)
| _ -> (word_t a)
noextract inline_for_extraction
val zero_element: a:Spec.alg -> m:m_spec -> element_t a m
noextract inline_for_extraction
let row_len (a:Spec.alg) (m:m_spec) : size_t =
match a,m with
| Spec.Blake2S,M128 -> 1ul
| Spec.Blake2S,M256 -> 1ul
| Spec.Blake2B,M256 -> 1ul
| _ -> 4ul
noextract inline_for_extraction
unfold let row_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (row_len a m)
noextract inline_for_extraction
val row_v: #a:Spec.alg -> #m:m_spec -> h:mem -> row_p a m -> GTot (Spec.row a)
noextract
val row_v_lemma: #a:Spec.alg -> #m:m_spec -> h0:mem -> h1:mem -> r1:row_p a m -> r2:row_p a m ->
Lemma (ensures (as_seq h0 r1 == as_seq h1 r2 ==>
row_v h0 r1 == row_v h1 r2))
[SMTPat (row_v h0 r1); SMTPat (row_v h1 r2)]
noextract inline_for_extraction
unfold let state_p (a:Spec.alg) (m:m_spec) =
lbuffer (element_t a m) (4ul *. row_len a m)
noextract inline_for_extraction
unfold let index_t = n:size_t{v n < 4}
noextract inline_for_extraction | false | false | Hacl.Impl.Blake2.Core.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val g_rowi (#a: Spec.alg) (#m: m_spec) (st: state_p a m) (idx: index_t) : GTot (row_p a m) | [] | Hacl.Impl.Blake2.Core.g_rowi | {
"file_name": "code/blake2/Hacl.Impl.Blake2.Core.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | st: Hacl.Impl.Blake2.Core.state_p a m -> idx: Hacl.Impl.Blake2.Core.index_t
-> Prims.GTot (Hacl.Impl.Blake2.Core.row_p a m) | {
"end_col": 44,
"end_line": 65,
"start_col": 2,
"start_line": 65
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.String",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let norm_typestring =
[
delta_only [
`%char_t_of_char;
`%string_t_of_chars;
`%mk_string_t;
];
iota; zeta; primops;
] | let norm_typestring = | false | null | false | [delta_only [`%char_t_of_char; `%string_t_of_chars; `%mk_string_t]; iota; zeta; primops] | {
"checked_file": "Steel.C.Typestring.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.String.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.C.Typestring.fsti"
} | [
"total"
] | [
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_only",
"Prims.string",
"Prims.Nil",
"FStar.Pervasives.iota",
"FStar.Pervasives.zeta",
"FStar.Pervasives.primops"
] | [] | module Steel.C.Typestring
(** Suppose [struct (t : string) (fields : struct_fields)] represents the type of struct values.
Then, when extracting values of type [ref (struct t fields)], the tag t is lost.
To make sure this information sticks around, this module provides
an encoding of strings like t as types. *)
val ca: Type0
val cb: Type0
val cc: Type0
val cd: Type0
val ce: Type0
val cf: Type0
val cg: Type0
val ch: Type0
val ci: Type0
val cj: Type0
val ck: Type0
val cl: Type0
val cm: Type0
val cn: Type0
val co: Type0
val cp: Type0
val cq: Type0
val cr: Type0
val cs: Type0
val ct: Type0
val cu: Type0
val cv: Type0
val cw: Type0
val cx: Type0
val cy: Type0
val cz: Type0
val cA: Type0
val cB: Type0
val cC: Type0
val cD: Type0
val cE: Type0
val cF: Type0
val cG: Type0
val cH: Type0
val cI: Type0
val cJ: Type0
val cK: Type0
val cL: Type0
val cM: Type0
val cN: Type0
val cO: Type0
val cP: Type0
val cQ: Type0
val cR: Type0
val cS: Type0
val cT: Type0
val cU: Type0
val cV: Type0
val cW: Type0
val cX: Type0
val cY: Type0
val cZ: Type0
val c0: Type0
val c1: Type0
val c2: Type0
val c3: Type0
val c4: Type0
val c5: Type0
val c6: Type0
val c7: Type0
val c8: Type0
val c9: Type0
val c_: Type0
val cdot: Type0
val string_nil: Type0
val string_cons (c: Type0) (s: Type0): Type0
open FStar.String
let char_t_of_char (c: char): Type0 =
match c with
| 'a' -> ca
| 'b' -> cb
| 'c' -> cc
| 'd' -> cd
| 'e' -> ce
| 'f' -> cf
| 'g' -> cg
| 'h' -> ch
| 'i' -> ci
| 'j' -> cj
| 'k' -> ck
| 'l' -> cl
| 'm' -> cm
| 'n' -> cn
| 'o' -> co
| 'p' -> cp
| 'q' -> cq
| 'r' -> cr
| 's' -> cs
| 't' -> ct
| 'u' -> cu
| 'v' -> cv
| 'w' -> cw
| 'x' -> cx
| 'y' -> cy
| 'z' -> cz
| 'A' -> cA
| 'B' -> cB
| 'C' -> cC
| 'D' -> cD
| 'E' -> cE
| 'F' -> cF
| 'G' -> cG
| 'H' -> cH
| 'I' -> cI
| 'J' -> cJ
| 'K' -> cK
| 'L' -> cL
| 'M' -> cM
| 'N' -> cN
| 'O' -> cO
| 'P' -> cP
| 'Q' -> cQ
| 'R' -> cR
| 'S' -> cS
| 'T' -> cT
| 'U' -> cU
| 'V' -> cV
| 'W' -> cW
| 'X' -> cX
| 'Y' -> cY
| 'Z' -> cZ
| '0' -> c0
| '1' -> c1
| '2' -> c2
| '3' -> c3
| '4' -> c4
| '5' -> c5
| '6' -> c6
| '7' -> c7
| '8' -> c8
| '9' -> c9
| '_' -> c_
| '.' -> cdot
| _ -> c_
let rec string_t_of_chars (s: list char): Type0 =
match s with
| [] -> string_nil
| c :: s -> string_cons (char_t_of_char c) (string_t_of_chars s)
let mk_string_t s: Type0 = string_t_of_chars (String.list_of_string s)
unfold | false | true | Steel.C.Typestring.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val norm_typestring : Prims.list FStar.Pervasives.norm_step | [] | Steel.C.Typestring.norm_typestring | {
"file_name": "lib/steel/c/Steel.C.Typestring.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | Prims.list FStar.Pervasives.norm_step | {
"end_col": 3,
"end_line": 162,
"start_col": 2,
"start_line": 155
} |
|
FStar.Tactics.Effect.Tac | [
{
"abbrev": false,
"full_module": "FStar.String",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let solve_mk_string_t () =
FStar.Tactics.norm norm_typestring;
FStar.Tactics.trefl () | let solve_mk_string_t () = | true | null | false | FStar.Tactics.norm norm_typestring;
FStar.Tactics.trefl () | {
"checked_file": "Steel.C.Typestring.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.String.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.C.Typestring.fsti"
} | [] | [
"Prims.unit",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Builtins.norm",
"Steel.C.Typestring.norm_typestring"
] | [] | module Steel.C.Typestring
(** Suppose [struct (t : string) (fields : struct_fields)] represents the type of struct values.
Then, when extracting values of type [ref (struct t fields)], the tag t is lost.
To make sure this information sticks around, this module provides
an encoding of strings like t as types. *)
val ca: Type0
val cb: Type0
val cc: Type0
val cd: Type0
val ce: Type0
val cf: Type0
val cg: Type0
val ch: Type0
val ci: Type0
val cj: Type0
val ck: Type0
val cl: Type0
val cm: Type0
val cn: Type0
val co: Type0
val cp: Type0
val cq: Type0
val cr: Type0
val cs: Type0
val ct: Type0
val cu: Type0
val cv: Type0
val cw: Type0
val cx: Type0
val cy: Type0
val cz: Type0
val cA: Type0
val cB: Type0
val cC: Type0
val cD: Type0
val cE: Type0
val cF: Type0
val cG: Type0
val cH: Type0
val cI: Type0
val cJ: Type0
val cK: Type0
val cL: Type0
val cM: Type0
val cN: Type0
val cO: Type0
val cP: Type0
val cQ: Type0
val cR: Type0
val cS: Type0
val cT: Type0
val cU: Type0
val cV: Type0
val cW: Type0
val cX: Type0
val cY: Type0
val cZ: Type0
val c0: Type0
val c1: Type0
val c2: Type0
val c3: Type0
val c4: Type0
val c5: Type0
val c6: Type0
val c7: Type0
val c8: Type0
val c9: Type0
val c_: Type0
val cdot: Type0
val string_nil: Type0
val string_cons (c: Type0) (s: Type0): Type0
open FStar.String
let char_t_of_char (c: char): Type0 =
match c with
| 'a' -> ca
| 'b' -> cb
| 'c' -> cc
| 'd' -> cd
| 'e' -> ce
| 'f' -> cf
| 'g' -> cg
| 'h' -> ch
| 'i' -> ci
| 'j' -> cj
| 'k' -> ck
| 'l' -> cl
| 'm' -> cm
| 'n' -> cn
| 'o' -> co
| 'p' -> cp
| 'q' -> cq
| 'r' -> cr
| 's' -> cs
| 't' -> ct
| 'u' -> cu
| 'v' -> cv
| 'w' -> cw
| 'x' -> cx
| 'y' -> cy
| 'z' -> cz
| 'A' -> cA
| 'B' -> cB
| 'C' -> cC
| 'D' -> cD
| 'E' -> cE
| 'F' -> cF
| 'G' -> cG
| 'H' -> cH
| 'I' -> cI
| 'J' -> cJ
| 'K' -> cK
| 'L' -> cL
| 'M' -> cM
| 'N' -> cN
| 'O' -> cO
| 'P' -> cP
| 'Q' -> cQ
| 'R' -> cR
| 'S' -> cS
| 'T' -> cT
| 'U' -> cU
| 'V' -> cV
| 'W' -> cW
| 'X' -> cX
| 'Y' -> cY
| 'Z' -> cZ
| '0' -> c0
| '1' -> c1
| '2' -> c2
| '3' -> c3
| '4' -> c4
| '5' -> c5
| '6' -> c6
| '7' -> c7
| '8' -> c8
| '9' -> c9
| '_' -> c_
| '.' -> cdot
| _ -> c_
let rec string_t_of_chars (s: list char): Type0 =
match s with
| [] -> string_nil
| c :: s -> string_cons (char_t_of_char c) (string_t_of_chars s)
let mk_string_t s: Type0 = string_t_of_chars (String.list_of_string s)
unfold
let norm_typestring =
[
delta_only [
`%char_t_of_char;
`%string_t_of_chars;
`%mk_string_t;
];
iota; zeta; primops;
] | false | false | Steel.C.Typestring.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val solve_mk_string_t : _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | [] | Steel.C.Typestring.solve_mk_string_t | {
"file_name": "lib/steel/c/Steel.C.Typestring.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | {
"end_col": 24,
"end_line": 166,
"start_col": 2,
"start_line": 165
} |
|
Prims.Tot | val char_t_of_char (c: char) : Type0 | [
{
"abbrev": false,
"full_module": "FStar.String",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let char_t_of_char (c: char): Type0 =
match c with
| 'a' -> ca
| 'b' -> cb
| 'c' -> cc
| 'd' -> cd
| 'e' -> ce
| 'f' -> cf
| 'g' -> cg
| 'h' -> ch
| 'i' -> ci
| 'j' -> cj
| 'k' -> ck
| 'l' -> cl
| 'm' -> cm
| 'n' -> cn
| 'o' -> co
| 'p' -> cp
| 'q' -> cq
| 'r' -> cr
| 's' -> cs
| 't' -> ct
| 'u' -> cu
| 'v' -> cv
| 'w' -> cw
| 'x' -> cx
| 'y' -> cy
| 'z' -> cz
| 'A' -> cA
| 'B' -> cB
| 'C' -> cC
| 'D' -> cD
| 'E' -> cE
| 'F' -> cF
| 'G' -> cG
| 'H' -> cH
| 'I' -> cI
| 'J' -> cJ
| 'K' -> cK
| 'L' -> cL
| 'M' -> cM
| 'N' -> cN
| 'O' -> cO
| 'P' -> cP
| 'Q' -> cQ
| 'R' -> cR
| 'S' -> cS
| 'T' -> cT
| 'U' -> cU
| 'V' -> cV
| 'W' -> cW
| 'X' -> cX
| 'Y' -> cY
| 'Z' -> cZ
| '0' -> c0
| '1' -> c1
| '2' -> c2
| '3' -> c3
| '4' -> c4
| '5' -> c5
| '6' -> c6
| '7' -> c7
| '8' -> c8
| '9' -> c9
| '_' -> c_
| '.' -> cdot
| _ -> c_ | val char_t_of_char (c: char) : Type0
let char_t_of_char (c: char) : Type0 = | false | null | false | match c with
| 'a' -> ca
| 'b' -> cb
| 'c' -> cc
| 'd' -> cd
| 'e' -> ce
| 'f' -> cf
| 'g' -> cg
| 'h' -> ch
| 'i' -> ci
| 'j' -> cj
| 'k' -> ck
| 'l' -> cl
| 'm' -> cm
| 'n' -> cn
| 'o' -> co
| 'p' -> cp
| 'q' -> cq
| 'r' -> cr
| 's' -> cs
| 't' -> ct
| 'u' -> cu
| 'v' -> cv
| 'w' -> cw
| 'x' -> cx
| 'y' -> cy
| 'z' -> cz
| 'A' -> cA
| 'B' -> cB
| 'C' -> cC
| 'D' -> cD
| 'E' -> cE
| 'F' -> cF
| 'G' -> cG
| 'H' -> cH
| 'I' -> cI
| 'J' -> cJ
| 'K' -> cK
| 'L' -> cL
| 'M' -> cM
| 'N' -> cN
| 'O' -> cO
| 'P' -> cP
| 'Q' -> cQ
| 'R' -> cR
| 'S' -> cS
| 'T' -> cT
| 'U' -> cU
| 'V' -> cV
| 'W' -> cW
| 'X' -> cX
| 'Y' -> cY
| 'Z' -> cZ
| '0' -> c0
| '1' -> c1
| '2' -> c2
| '3' -> c3
| '4' -> c4
| '5' -> c5
| '6' -> c6
| '7' -> c7
| '8' -> c8
| '9' -> c9
| '_' -> c_
| '.' -> cdot
| _ -> c_ | {
"checked_file": "Steel.C.Typestring.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.String.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.C.Typestring.fsti"
} | [
"total"
] | [
"FStar.String.char",
"Steel.C.Typestring.ca",
"Steel.C.Typestring.cb",
"Steel.C.Typestring.cc",
"Steel.C.Typestring.cd",
"Steel.C.Typestring.ce",
"Steel.C.Typestring.cf",
"Steel.C.Typestring.cg",
"Steel.C.Typestring.ch",
"Steel.C.Typestring.ci",
"Steel.C.Typestring.cj",
"Steel.C.Typestring.ck",
"Steel.C.Typestring.cl",
"Steel.C.Typestring.cm",
"Steel.C.Typestring.cn",
"Steel.C.Typestring.co",
"Steel.C.Typestring.cp",
"Steel.C.Typestring.cq",
"Steel.C.Typestring.cr",
"Steel.C.Typestring.cs",
"Steel.C.Typestring.ct",
"Steel.C.Typestring.cu",
"Steel.C.Typestring.cv",
"Steel.C.Typestring.cw",
"Steel.C.Typestring.cx",
"Steel.C.Typestring.cy",
"Steel.C.Typestring.cz",
"Steel.C.Typestring.cA",
"Steel.C.Typestring.cB",
"Steel.C.Typestring.cC",
"Steel.C.Typestring.cD",
"Steel.C.Typestring.cE",
"Steel.C.Typestring.cF",
"Steel.C.Typestring.cG",
"Steel.C.Typestring.cH",
"Steel.C.Typestring.cI",
"Steel.C.Typestring.cJ",
"Steel.C.Typestring.cK",
"Steel.C.Typestring.cL",
"Steel.C.Typestring.cM",
"Steel.C.Typestring.cN",
"Steel.C.Typestring.cO",
"Steel.C.Typestring.cP",
"Steel.C.Typestring.cQ",
"Steel.C.Typestring.cR",
"Steel.C.Typestring.cS",
"Steel.C.Typestring.cT",
"Steel.C.Typestring.cU",
"Steel.C.Typestring.cV",
"Steel.C.Typestring.cW",
"Steel.C.Typestring.cX",
"Steel.C.Typestring.cY",
"Steel.C.Typestring.cZ",
"Steel.C.Typestring.c0",
"Steel.C.Typestring.c1",
"Steel.C.Typestring.c2",
"Steel.C.Typestring.c3",
"Steel.C.Typestring.c4",
"Steel.C.Typestring.c5",
"Steel.C.Typestring.c6",
"Steel.C.Typestring.c7",
"Steel.C.Typestring.c8",
"Steel.C.Typestring.c9",
"Steel.C.Typestring.c_",
"Steel.C.Typestring.cdot",
"FStar.Char.char"
] | [] | module Steel.C.Typestring
(** Suppose [struct (t : string) (fields : struct_fields)] represents the type of struct values.
Then, when extracting values of type [ref (struct t fields)], the tag t is lost.
To make sure this information sticks around, this module provides
an encoding of strings like t as types. *)
val ca: Type0
val cb: Type0
val cc: Type0
val cd: Type0
val ce: Type0
val cf: Type0
val cg: Type0
val ch: Type0
val ci: Type0
val cj: Type0
val ck: Type0
val cl: Type0
val cm: Type0
val cn: Type0
val co: Type0
val cp: Type0
val cq: Type0
val cr: Type0
val cs: Type0
val ct: Type0
val cu: Type0
val cv: Type0
val cw: Type0
val cx: Type0
val cy: Type0
val cz: Type0
val cA: Type0
val cB: Type0
val cC: Type0
val cD: Type0
val cE: Type0
val cF: Type0
val cG: Type0
val cH: Type0
val cI: Type0
val cJ: Type0
val cK: Type0
val cL: Type0
val cM: Type0
val cN: Type0
val cO: Type0
val cP: Type0
val cQ: Type0
val cR: Type0
val cS: Type0
val cT: Type0
val cU: Type0
val cV: Type0
val cW: Type0
val cX: Type0
val cY: Type0
val cZ: Type0
val c0: Type0
val c1: Type0
val c2: Type0
val c3: Type0
val c4: Type0
val c5: Type0
val c6: Type0
val c7: Type0
val c8: Type0
val c9: Type0
val c_: Type0
val cdot: Type0
val string_nil: Type0
val string_cons (c: Type0) (s: Type0): Type0
open FStar.String | false | true | Steel.C.Typestring.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val char_t_of_char (c: char) : Type0 | [] | Steel.C.Typestring.char_t_of_char | {
"file_name": "lib/steel/c/Steel.C.Typestring.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | c: FStar.String.char -> Type0 | {
"end_col": 11,
"end_line": 144,
"start_col": 2,
"start_line": 79
} |
Prims.Tot | val string_t_of_chars (s: list char) : Type0 | [
{
"abbrev": false,
"full_module": "FStar.String",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.C",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec string_t_of_chars (s: list char): Type0 =
match s with
| [] -> string_nil
| c :: s -> string_cons (char_t_of_char c) (string_t_of_chars s) | val string_t_of_chars (s: list char) : Type0
let rec string_t_of_chars (s: list char) : Type0 = | false | null | false | match s with
| [] -> string_nil
| c :: s -> string_cons (char_t_of_char c) (string_t_of_chars s) | {
"checked_file": "Steel.C.Typestring.fsti.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.String.fsti.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.C.Typestring.fsti"
} | [
"total"
] | [
"Prims.list",
"FStar.String.char",
"Steel.C.Typestring.string_nil",
"Steel.C.Typestring.string_cons",
"Steel.C.Typestring.char_t_of_char",
"Steel.C.Typestring.string_t_of_chars"
] | [] | module Steel.C.Typestring
(** Suppose [struct (t : string) (fields : struct_fields)] represents the type of struct values.
Then, when extracting values of type [ref (struct t fields)], the tag t is lost.
To make sure this information sticks around, this module provides
an encoding of strings like t as types. *)
val ca: Type0
val cb: Type0
val cc: Type0
val cd: Type0
val ce: Type0
val cf: Type0
val cg: Type0
val ch: Type0
val ci: Type0
val cj: Type0
val ck: Type0
val cl: Type0
val cm: Type0
val cn: Type0
val co: Type0
val cp: Type0
val cq: Type0
val cr: Type0
val cs: Type0
val ct: Type0
val cu: Type0
val cv: Type0
val cw: Type0
val cx: Type0
val cy: Type0
val cz: Type0
val cA: Type0
val cB: Type0
val cC: Type0
val cD: Type0
val cE: Type0
val cF: Type0
val cG: Type0
val cH: Type0
val cI: Type0
val cJ: Type0
val cK: Type0
val cL: Type0
val cM: Type0
val cN: Type0
val cO: Type0
val cP: Type0
val cQ: Type0
val cR: Type0
val cS: Type0
val cT: Type0
val cU: Type0
val cV: Type0
val cW: Type0
val cX: Type0
val cY: Type0
val cZ: Type0
val c0: Type0
val c1: Type0
val c2: Type0
val c3: Type0
val c4: Type0
val c5: Type0
val c6: Type0
val c7: Type0
val c8: Type0
val c9: Type0
val c_: Type0
val cdot: Type0
val string_nil: Type0
val string_cons (c: Type0) (s: Type0): Type0
open FStar.String
let char_t_of_char (c: char): Type0 =
match c with
| 'a' -> ca
| 'b' -> cb
| 'c' -> cc
| 'd' -> cd
| 'e' -> ce
| 'f' -> cf
| 'g' -> cg
| 'h' -> ch
| 'i' -> ci
| 'j' -> cj
| 'k' -> ck
| 'l' -> cl
| 'm' -> cm
| 'n' -> cn
| 'o' -> co
| 'p' -> cp
| 'q' -> cq
| 'r' -> cr
| 's' -> cs
| 't' -> ct
| 'u' -> cu
| 'v' -> cv
| 'w' -> cw
| 'x' -> cx
| 'y' -> cy
| 'z' -> cz
| 'A' -> cA
| 'B' -> cB
| 'C' -> cC
| 'D' -> cD
| 'E' -> cE
| 'F' -> cF
| 'G' -> cG
| 'H' -> cH
| 'I' -> cI
| 'J' -> cJ
| 'K' -> cK
| 'L' -> cL
| 'M' -> cM
| 'N' -> cN
| 'O' -> cO
| 'P' -> cP
| 'Q' -> cQ
| 'R' -> cR
| 'S' -> cS
| 'T' -> cT
| 'U' -> cU
| 'V' -> cV
| 'W' -> cW
| 'X' -> cX
| 'Y' -> cY
| 'Z' -> cZ
| '0' -> c0
| '1' -> c1
| '2' -> c2
| '3' -> c3
| '4' -> c4
| '5' -> c5
| '6' -> c6
| '7' -> c7
| '8' -> c8
| '9' -> c9
| '_' -> c_
| '.' -> cdot
| _ -> c_ | false | true | Steel.C.Typestring.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val string_t_of_chars (s: list char) : Type0 | [
"recursion"
] | Steel.C.Typestring.string_t_of_chars | {
"file_name": "lib/steel/c/Steel.C.Typestring.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | s: Prims.list FStar.String.char -> Type0 | {
"end_col": 66,
"end_line": 149,
"start_col": 2,
"start_line": 147
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Curve25519",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let felem4 = (uint64 * uint64 * uint64 * uint64) | let felem4 = | false | null | false | (((uint64 * uint64) * uint64) * uint64) | {
"checked_file": "Hacl.Spec.Curve25519.Field64.Definition.fst.checked",
"dependencies": [
"Spec.Curve25519.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Spec.Bignum.Convert.fst.checked",
"Hacl.Impl.Curve25519.Lemmas.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Curve25519.Field64.Definition.fst"
} | [
"total"
] | [
"FStar.Pervasives.Native.tuple4",
"Lib.IntTypes.uint64"
] | [] | module Hacl.Spec.Curve25519.Field64.Definition
open Lib.Sequence
open Lib.IntTypes
module P = Spec.Curve25519
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0" | false | true | Hacl.Spec.Curve25519.Field64.Definition.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val felem4 : Type0 | [] | Hacl.Spec.Curve25519.Field64.Definition.felem4 | {
"file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.Definition.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 48,
"end_line": 10,
"start_col": 13,
"start_line": 10
} |
|
Prims.GTot | val feval4 (f: felem4) : GTot P.elem | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Curve25519",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let feval4 (f:felem4) : GTot P.elem = as_nat4 f % P.prime | val feval4 (f: felem4) : GTot P.elem
let feval4 (f: felem4) : GTot P.elem = | false | null | false | as_nat4 f % P.prime | {
"checked_file": "Hacl.Spec.Curve25519.Field64.Definition.fst.checked",
"dependencies": [
"Spec.Curve25519.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Spec.Bignum.Convert.fst.checked",
"Hacl.Impl.Curve25519.Lemmas.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Curve25519.Field64.Definition.fst"
} | [
"sometrivial"
] | [
"Hacl.Spec.Curve25519.Field64.Definition.felem4",
"Prims.op_Modulus",
"Hacl.Spec.Curve25519.Field64.Definition.as_nat4",
"Spec.Curve25519.prime",
"Spec.Curve25519.elem"
] | [] | module Hacl.Spec.Curve25519.Field64.Definition
open Lib.Sequence
open Lib.IntTypes
module P = Spec.Curve25519
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let felem4 = (uint64 * uint64 * uint64 * uint64)
open FStar.Mul
noextract
val as_nat4: f:felem4 -> GTot nat
let as_nat4 f =
let (s0, s1, s2, s3) = f in
v s0 + v s1 * pow2 64 + v s2 * pow2 64 * pow2 64 +
v s3 * pow2 64 * pow2 64 * pow2 64 | false | false | Hacl.Spec.Curve25519.Field64.Definition.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val feval4 (f: felem4) : GTot P.elem | [] | Hacl.Spec.Curve25519.Field64.Definition.feval4 | {
"file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.Definition.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Spec.Curve25519.Field64.Definition.felem4 -> Prims.GTot Spec.Curve25519.elem | {
"end_col": 57,
"end_line": 21,
"start_col": 38,
"start_line": 21
} |
Prims.GTot | val as_nat4: f:felem4 -> GTot nat | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Curve25519",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let as_nat4 f =
let (s0, s1, s2, s3) = f in
v s0 + v s1 * pow2 64 + v s2 * pow2 64 * pow2 64 +
v s3 * pow2 64 * pow2 64 * pow2 64 | val as_nat4: f:felem4 -> GTot nat
let as_nat4 f = | false | null | false | let s0, s1, s2, s3 = f in
v s0 + v s1 * pow2 64 + (v s2 * pow2 64) * pow2 64 + ((v s3 * pow2 64) * pow2 64) * pow2 64 | {
"checked_file": "Hacl.Spec.Curve25519.Field64.Definition.fst.checked",
"dependencies": [
"Spec.Curve25519.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Spec.Bignum.Convert.fst.checked",
"Hacl.Impl.Curve25519.Lemmas.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Curve25519.Field64.Definition.fst"
} | [
"sometrivial"
] | [
"Hacl.Spec.Curve25519.Field64.Definition.felem4",
"Lib.IntTypes.uint64",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.Mul.op_Star",
"Prims.pow2",
"Prims.nat"
] | [] | module Hacl.Spec.Curve25519.Field64.Definition
open Lib.Sequence
open Lib.IntTypes
module P = Spec.Curve25519
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let felem4 = (uint64 * uint64 * uint64 * uint64)
open FStar.Mul
noextract | false | false | Hacl.Spec.Curve25519.Field64.Definition.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val as_nat4: f:felem4 -> GTot nat | [] | Hacl.Spec.Curve25519.Field64.Definition.as_nat4 | {
"file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.Definition.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Hacl.Spec.Curve25519.Field64.Definition.felem4 -> Prims.GTot Prims.nat | {
"end_col": 36,
"end_line": 19,
"start_col": 15,
"start_line": 16
} |
FStar.Pervasives.Lemma | val bn_v_is_as_nat: e:lseq uint64 4 ->
Lemma (as_nat4 (e.[0], e.[1], e.[2], e.[3]) == Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Curve25519",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Curve25519.Field64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bn_v_is_as_nat e =
Hacl.Impl.Curve25519.Lemmas.lemma_nat_from_uints64_le_4 e;
assert (as_nat4 (e.[0], e.[1], e.[2], e.[3]) == Lib.ByteSequence.nat_from_intseq_le e);
Hacl.Spec.Bignum.Convert.bn_v_is_nat_from_intseq_le_lemma 4 e;
assert (Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e == Lib.ByteSequence.nat_from_intseq_le e) | val bn_v_is_as_nat: e:lseq uint64 4 ->
Lemma (as_nat4 (e.[0], e.[1], e.[2], e.[3]) == Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e)
let bn_v_is_as_nat e = | false | null | true | Hacl.Impl.Curve25519.Lemmas.lemma_nat_from_uints64_le_4 e;
assert (as_nat4 (e.[ 0 ], e.[ 1 ], e.[ 2 ], e.[ 3 ]) == Lib.ByteSequence.nat_from_intseq_le e);
Hacl.Spec.Bignum.Convert.bn_v_is_nat_from_intseq_le_lemma 4 e;
assert (Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e == Lib.ByteSequence.nat_from_intseq_le e) | {
"checked_file": "Hacl.Spec.Curve25519.Field64.Definition.fst.checked",
"dependencies": [
"Spec.Curve25519.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"Hacl.Spec.Bignum.Convert.fst.checked",
"Hacl.Impl.Curve25519.Lemmas.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Curve25519.Field64.Definition.fst"
} | [
"lemma"
] | [
"Lib.Sequence.lseq",
"Lib.IntTypes.uint64",
"Prims._assert",
"Prims.eq2",
"Prims.nat",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Lib.ByteSequence.nat_from_intseq_le",
"Lib.IntTypes.SEC",
"Prims.unit",
"Hacl.Spec.Bignum.Convert.bn_v_is_nat_from_intseq_le_lemma",
"Hacl.Spec.Curve25519.Field64.Definition.as_nat4",
"FStar.Pervasives.Native.Mktuple4",
"Lib.Sequence.op_String_Access",
"Hacl.Impl.Curve25519.Lemmas.lemma_nat_from_uints64_le_4"
] | [] | module Hacl.Spec.Curve25519.Field64.Definition
open Lib.Sequence
open Lib.IntTypes
module P = Spec.Curve25519
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let felem4 = (uint64 * uint64 * uint64 * uint64)
open FStar.Mul
noextract
val as_nat4: f:felem4 -> GTot nat
let as_nat4 f =
let (s0, s1, s2, s3) = f in
v s0 + v s1 * pow2 64 + v s2 * pow2 64 * pow2 64 +
v s3 * pow2 64 * pow2 64 * pow2 64
let feval4 (f:felem4) : GTot P.elem = as_nat4 f % P.prime
val bn_v_is_as_nat: e:lseq uint64 4 ->
Lemma (as_nat4 (e.[0], e.[1], e.[2], e.[3]) == Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e) | false | false | Hacl.Spec.Curve25519.Field64.Definition.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val bn_v_is_as_nat: e:lseq uint64 4 ->
Lemma (as_nat4 (e.[0], e.[1], e.[2], e.[3]) == Hacl.Spec.Bignum.Definitions.bn_v #U64 #4 e) | [] | Hacl.Spec.Curve25519.Field64.Definition.bn_v_is_as_nat | {
"file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.Definition.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | e: Lib.Sequence.lseq Lib.IntTypes.uint64 4
-> FStar.Pervasives.Lemma
(ensures
Hacl.Spec.Curve25519.Field64.Definition.as_nat4 (e.[ 0 ], e.[ 1 ], e.[ 2 ], e.[ 3 ]) ==
Hacl.Spec.Bignum.Definitions.bn_v e) | {
"end_col": 95,
"end_line": 30,
"start_col": 2,
"start_line": 27
} |
Prims.Tot | val bv_of_binder (b: binder) : bv | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv | val bv_of_binder (b: binder) : bv
let bv_of_binder (b: binder) : bv = | false | null | false | (inspect_binder b).binder_bv | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.binder",
"FStar.Reflection.V1.Data.__proj__Mkbinder_view__item__binder_bv",
"FStar.Reflection.V1.Builtins.inspect_binder",
"FStar.Reflection.Types.bv"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val bv_of_binder (b: binder) : bv | [] | FStar.Reflection.V1.Derived.bv_of_binder | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | b: FStar.Reflection.Types.binder -> FStar.Reflection.Types.bv | {
"end_col": 65,
"end_line": 25,
"start_col": 37,
"start_line": 25
} |
Prims.Tot | val collect_app_ln : term -> term * list argv | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let collect_app_ln = collect_app_ln' [] | val collect_app_ln : term -> term * list argv
let collect_app_ln = | false | null | false | collect_app_ln' [] | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.V1.Derived.collect_app_ln'",
"Prims.Nil",
"FStar.Reflection.V1.Data.argv"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val collect_app_ln : term -> term * list argv | [] | FStar.Reflection.V1.Derived.collect_app_ln | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | _: FStar.Reflection.Types.term
-> FStar.Reflection.Types.term * Prims.list FStar.Reflection.V1.Data.argv | {
"end_col": 39,
"end_line": 70,
"start_col": 21,
"start_line": 70
} |
Prims.Tot | val mk_binder (bv: bv) (sort: typ) : binder | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
} | val mk_binder (bv: bv) (sort: typ) : binder
let mk_binder (bv: bv) (sort: typ) : binder = | false | null | false | pack_binder ({ binder_bv = bv; binder_qual = Q_Explicit; binder_attrs = []; binder_sort = sort }) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.bv",
"FStar.Reflection.Types.typ",
"FStar.Reflection.V1.Builtins.pack_binder",
"FStar.Reflection.V1.Data.Mkbinder_view",
"FStar.Reflection.V1.Data.Q_Explicit",
"Prims.Nil",
"FStar.Reflection.Types.term",
"FStar.Reflection.Types.binder"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_binder (bv: bv) (sort: typ) : binder | [] | FStar.Reflection.V1.Derived.mk_binder | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | bv: FStar.Reflection.Types.bv -> sort: FStar.Reflection.Types.typ -> FStar.Reflection.Types.binder | {
"end_col": 3,
"end_line": 42,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val mk_implicit_binder (bv: bv) (sort: typ) : binder | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
} | val mk_implicit_binder (bv: bv) (sort: typ) : binder
let mk_implicit_binder (bv: bv) (sort: typ) : binder = | false | null | false | pack_binder ({ binder_bv = bv; binder_qual = Q_Implicit; binder_attrs = []; binder_sort = sort }) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.bv",
"FStar.Reflection.Types.typ",
"FStar.Reflection.V1.Builtins.pack_binder",
"FStar.Reflection.V1.Data.Mkbinder_view",
"FStar.Reflection.V1.Data.Q_Implicit",
"Prims.Nil",
"FStar.Reflection.Types.term",
"FStar.Reflection.Types.binder"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
} | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_implicit_binder (bv: bv) (sort: typ) : binder | [] | FStar.Reflection.V1.Derived.mk_implicit_binder | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | bv: FStar.Reflection.Types.bv -> sort: FStar.Reflection.Types.typ -> FStar.Reflection.Types.binder | {
"end_col": 3,
"end_line": 50,
"start_col": 2,
"start_line": 45
} |
Prims.Tot | val mk_e_app (t: term) (args: list term) : Tot term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args) | val mk_e_app (t: term) (args: list term) : Tot term
let mk_e_app (t: term) (args: list term) : Tot term = | false | null | false | let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"Prims.list",
"FStar.Reflection.V1.Derived.mk_app",
"FStar.List.Tot.Base.map",
"FStar.Reflection.V1.Data.argv",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Data.aqualv",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Reflection.V1.Data.Q_Explicit"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_e_app (t: term) (args: list term) : Tot term | [] | FStar.Reflection.V1.Derived.mk_e_app | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> args: Prims.list FStar.Reflection.Types.term
-> FStar.Reflection.Types.term | {
"end_col": 39,
"end_line": 80,
"start_col": 55,
"start_line": 78
} |
Prims.Tot | val fv_to_string (fv: fv) : string | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv) | val fv_to_string (fv: fv) : string
let fv_to_string (fv: fv) : string = | false | null | false | implode_qn (inspect_fv fv) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.fv",
"FStar.Reflection.V1.Builtins.implode_qn",
"FStar.Reflection.V1.Builtins.inspect_fv",
"Prims.string"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t') | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fv_to_string (fv: fv) : string | [] | FStar.Reflection.V1.Derived.fv_to_string | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | fv: FStar.Reflection.Types.fv -> Prims.string | {
"end_col": 62,
"end_line": 122,
"start_col": 36,
"start_line": 122
} |
Prims.Tot | val mk_cons_t (ty h t: term) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)] | val mk_cons_t (ty h t: term) : term
let mk_cons_t (ty h t: term) : term = | false | null | false | mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)] | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Derived.mk_app",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_FVar",
"FStar.Reflection.V1.Builtins.pack_fv",
"FStar.Reflection.Const.cons_qn",
"Prims.Cons",
"FStar.Reflection.V1.Data.argv",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Reflection.V1.Data.aqualv",
"FStar.Reflection.V1.Data.Q_Implicit",
"FStar.Reflection.V1.Data.Q_Explicit",
"Prims.Nil"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t] | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_cons_t (ty h t: term) : term | [] | FStar.Reflection.V1.Derived.mk_cons_t | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | ty: FStar.Reflection.Types.term -> h: FStar.Reflection.Types.term -> t: FStar.Reflection.Types.term
-> FStar.Reflection.Types.term | {
"end_col": 100,
"end_line": 134,
"start_col": 3,
"start_line": 134
} |
Prims.Tot | val type_of_binder (b: binder) : typ | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort | val type_of_binder (b: binder) : typ
let type_of_binder (b: binder) : typ = | false | null | false | (inspect_binder b).binder_sort | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.binder",
"FStar.Reflection.V1.Data.__proj__Mkbinder_view__item__binder_sort",
"FStar.Reflection.V1.Builtins.inspect_binder",
"FStar.Reflection.Types.typ"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
} | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val type_of_binder (b: binder) : typ | [] | FStar.Reflection.V1.Derived.type_of_binder | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | b: FStar.Reflection.Types.binder -> FStar.Reflection.Types.typ | {
"end_col": 34,
"end_line": 53,
"start_col": 4,
"start_line": 53
} |
Prims.Tot | val is_fvar (t: term) (nm: string) : bool | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false | val is_fvar (t: term) (nm: string) : bool
let is_fvar (t: term) (nm: string) : bool = | false | null | false | match inspect_ln_unascribe t with
| Tv_FVar fv | Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"Prims.string",
"FStar.Reflection.V1.Derived.inspect_ln_unascribe",
"FStar.Reflection.Types.fv",
"Prims.op_Equality",
"FStar.Reflection.V1.Builtins.implode_qn",
"FStar.Reflection.V1.Builtins.inspect_fv",
"FStar.Reflection.V1.Data.universes",
"FStar.Reflection.V1.Data.term_view",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val is_fvar (t: term) (nm: string) : bool | [] | FStar.Reflection.V1.Derived.is_fvar | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> nm: Prims.string -> Prims.bool | {
"end_col": 16,
"end_line": 201,
"start_col": 4,
"start_line": 198
} |
Prims.Tot | val collect_abs_ln : term -> list binder * term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t') | val collect_abs_ln : term -> list binder * term
let collect_abs_ln t = | false | null | false | let bs, t' = collect_abs' [] t in
(List.Tot.Base.rev bs, t') | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"Prims.list",
"FStar.Reflection.Types.binder",
"FStar.Pervasives.Native.Mktuple2",
"FStar.List.Tot.Base.rev",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Derived.collect_abs'",
"Prims.Nil"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val collect_abs_ln : term -> list binder * term | [] | FStar.Reflection.V1.Derived.collect_abs_ln | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term
-> Prims.list FStar.Reflection.Types.binder * FStar.Reflection.Types.term | {
"end_col": 30,
"end_line": 120,
"start_col": 22,
"start_line": 118
} |
Prims.Tot | val u_unk:universe | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let u_unk : universe = pack_universe Uv_Unk | val u_unk:universe
let u_unk:universe = | false | null | false | pack_universe Uv_Unk | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.V1.Builtins.pack_universe",
"FStar.Reflection.V1.Data.Uv_Unk"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val u_unk:universe | [] | FStar.Reflection.V1.Derived.u_unk | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | FStar.Reflection.Types.universe | {
"end_col": 43,
"end_line": 82,
"start_col": 23,
"start_line": 82
} |
Prims.Tot | val collect_arr_ln : typ -> list typ * comp | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c | val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t = | false | null | false | let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.typ",
"Prims.list",
"FStar.Reflection.Types.binder",
"FStar.Reflection.Types.comp",
"FStar.Pervasives.Native.Mktuple2",
"FStar.List.Tot.Base.map",
"FStar.Reflection.V1.Derived.type_of_binder",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Derived.collect_arr_ln_bs"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val collect_arr_ln : typ -> list typ * comp | [] | FStar.Reflection.V1.Derived.collect_arr_ln | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.typ -> Prims.list FStar.Reflection.Types.typ * FStar.Reflection.Types.comp | {
"end_col": 42,
"end_line": 109,
"start_col": 22,
"start_line": 107
} |
Prims.Tot | val mk_cons (h t: term) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t] | val mk_cons (h t: term) : term
let mk_cons (h t: term) : term = | false | null | false | mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t] | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Derived.mk_e_app",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_FVar",
"FStar.Reflection.V1.Builtins.pack_fv",
"FStar.Reflection.Const.cons_qn",
"Prims.Cons",
"Prims.Nil"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2] | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_cons (h t: term) : term | [] | FStar.Reflection.V1.Derived.mk_cons | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | h: FStar.Reflection.Types.term -> t: FStar.Reflection.Types.term -> FStar.Reflection.Types.term | {
"end_col": 56,
"end_line": 131,
"start_col": 3,
"start_line": 131
} |
Prims.Tot | val mk_strcat (t1 t2: term) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2] | val mk_strcat (t1 t2: term) : term
let mk_strcat (t1 t2: term) : term = | false | null | false | mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2] | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Derived.mk_e_app",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_FVar",
"FStar.Reflection.V1.Builtins.pack_fv",
"Prims.Cons",
"Prims.string",
"Prims.Nil"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s)) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_strcat (t1 t2: term) : term | [] | FStar.Reflection.V1.Derived.mk_strcat | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t1: FStar.Reflection.Types.term -> t2: FStar.Reflection.Types.term -> FStar.Reflection.Types.term | {
"end_col": 71,
"end_line": 128,
"start_col": 4,
"start_line": 128
} |
Prims.Tot | val mk_stringlit (s: string) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s)) | val mk_stringlit (s: string) : term
let mk_stringlit (s: string) : term = | false | null | false | pack_ln (Tv_Const (C_String s)) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"Prims.string",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_Const",
"FStar.Reflection.V1.Data.C_String",
"FStar.Reflection.Types.term"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_stringlit (s: string) : term | [] | FStar.Reflection.V1.Derived.mk_stringlit | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | s: Prims.string -> FStar.Reflection.Types.term | {
"end_col": 35,
"end_line": 125,
"start_col": 4,
"start_line": 125
} |
Prims.Tot | val unsquash_term (t: term) : option term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let unsquash_term (t : term) : option term =
match inspect_ln_unascribe t with
| Tv_App l (r, Q_Explicit) ->
if is_name_imp squash_qn l
then Some r
else None
| _ -> None | val unsquash_term (t: term) : option term
let unsquash_term (t: term) : option term = | false | null | false | match inspect_ln_unascribe t with
| Tv_App l (r, Q_Explicit) -> if is_name_imp squash_qn l then Some r else None
| _ -> None | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Derived.inspect_ln_unascribe",
"FStar.Reflection.V1.Derived.is_name_imp",
"FStar.Reflection.Const.squash_qn",
"FStar.Pervasives.Native.Some",
"Prims.bool",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.option",
"FStar.Reflection.V1.Data.term_view"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *)
let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false
(** Checks if a term `t` is equal to any FV (a top level name) from
those given in the list. Ignores universes and ascriptions. *)
let rec is_any_fvar (t : term) (nms:list string) : bool =
match nms with
| [] -> false
| v::vs -> is_fvar t v || is_any_fvar t vs
let is_uvar (t : term) : bool =
match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false
let binder_set_qual (q:aqualv) (b:binder) : Tot binder =
let bview = inspect_binder b in
pack_binder {bview with binder_qual=q}
(** Set a vconfig for a sigelt *)
val add_check_with : vconfig -> sigelt -> Tot sigelt
let add_check_with vcfg se =
let attrs = sigelt_attrs se in
let vcfg_t = embed_vconfig vcfg in
let t = `(check_with (`#vcfg_t)) in
set_sigelt_attrs (t :: attrs) se
let un_uinst (t:term) : term =
match inspect_ln t with
| Tv_UInst fv _ -> pack_ln (Tv_FVar fv)
| _ -> t
(* Returns [true] iff the term [t] is just the name [nm], though
possibly universe-instantiated and applied to some implicit arguments.
*)
let rec is_name_imp (nm : name) (t : term) : bool =
begin match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ ->
if inspect_fv fv = nm
then true
else false
| Tv_App l (_, Q_Implicit) ->
is_name_imp nm l
| _ -> false
end
(* If t is of the shape [squash t'], return [Some t'],
otherwise [None]. *) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val unsquash_term (t: term) : option term | [] | FStar.Reflection.V1.Derived.unsquash_term | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> FStar.Pervasives.Native.option FStar.Reflection.Types.term | {
"end_col": 15,
"end_line": 255,
"start_col": 4,
"start_line": 250
} |
Prims.Tot | val is_uvar (t: term) : bool | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let is_uvar (t : term) : bool =
match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false | val is_uvar (t: term) : bool
let is_uvar (t: term) : bool = | false | null | false | match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.inspect_ln",
"FStar.Reflection.V1.Derived.head",
"Prims.nat",
"FStar.Reflection.Types.ctx_uvar_and_subst",
"FStar.Reflection.V1.Data.term_view",
"Prims.bool"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *)
let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false
(** Checks if a term `t` is equal to any FV (a top level name) from
those given in the list. Ignores universes and ascriptions. *)
let rec is_any_fvar (t : term) (nms:list string) : bool =
match nms with
| [] -> false
| v::vs -> is_fvar t v || is_any_fvar t vs | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val is_uvar (t: term) : bool | [] | FStar.Reflection.V1.Derived.is_uvar | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> Prims.bool | {
"end_col": 16,
"end_line": 213,
"start_col": 4,
"start_line": 211
} |
Prims.Tot | val collect_arr_ln_bs : typ -> list binder * comp | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c) | val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t = | false | null | false | let bs, c = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.typ",
"Prims.list",
"FStar.Reflection.Types.binder",
"FStar.Reflection.Types.comp",
"FStar.Pervasives.Native.Mktuple2",
"FStar.List.Tot.Base.rev",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Derived.collect_arr'",
"Prims.Nil",
"FStar.Reflection.V1.Builtins.pack_comp",
"FStar.Reflection.V1.Data.C_Total"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val collect_arr_ln_bs : typ -> list binder * comp | [] | FStar.Reflection.V1.Derived.collect_arr_ln_bs | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.typ
-> Prims.list FStar.Reflection.Types.binder * FStar.Reflection.Types.comp | {
"end_col": 29,
"end_line": 104,
"start_col": 25,
"start_line": 102
} |
Prims.Tot | val un_uinst (t: term) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let un_uinst (t:term) : term =
match inspect_ln t with
| Tv_UInst fv _ -> pack_ln (Tv_FVar fv)
| _ -> t | val un_uinst (t: term) : term
let un_uinst (t: term) : term = | false | null | false | match inspect_ln t with
| Tv_UInst fv _ -> pack_ln (Tv_FVar fv)
| _ -> t | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.inspect_ln",
"FStar.Reflection.Types.fv",
"FStar.Reflection.V1.Data.universes",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_FVar",
"FStar.Reflection.V1.Data.term_view"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *)
let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false
(** Checks if a term `t` is equal to any FV (a top level name) from
those given in the list. Ignores universes and ascriptions. *)
let rec is_any_fvar (t : term) (nms:list string) : bool =
match nms with
| [] -> false
| v::vs -> is_fvar t v || is_any_fvar t vs
let is_uvar (t : term) : bool =
match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false
let binder_set_qual (q:aqualv) (b:binder) : Tot binder =
let bview = inspect_binder b in
pack_binder {bview with binder_qual=q}
(** Set a vconfig for a sigelt *)
val add_check_with : vconfig -> sigelt -> Tot sigelt
let add_check_with vcfg se =
let attrs = sigelt_attrs se in
let vcfg_t = embed_vconfig vcfg in
let t = `(check_with (`#vcfg_t)) in
set_sigelt_attrs (t :: attrs) se | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val un_uinst (t: term) : term | [] | FStar.Reflection.V1.Derived.un_uinst | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> FStar.Reflection.Types.term | {
"end_col": 10,
"end_line": 230,
"start_col": 2,
"start_line": 228
} |
Prims.Tot | val binder_set_qual (q: aqualv) (b: binder) : Tot binder | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let binder_set_qual (q:aqualv) (b:binder) : Tot binder =
let bview = inspect_binder b in
pack_binder {bview with binder_qual=q} | val binder_set_qual (q: aqualv) (b: binder) : Tot binder
let binder_set_qual (q: aqualv) (b: binder) : Tot binder = | false | null | false | let bview = inspect_binder b in
pack_binder ({ bview with binder_qual = q }) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.V1.Data.aqualv",
"FStar.Reflection.Types.binder",
"FStar.Reflection.V1.Builtins.pack_binder",
"FStar.Reflection.V1.Data.Mkbinder_view",
"FStar.Reflection.V1.Data.__proj__Mkbinder_view__item__binder_bv",
"FStar.Reflection.V1.Data.__proj__Mkbinder_view__item__binder_attrs",
"FStar.Reflection.V1.Data.__proj__Mkbinder_view__item__binder_sort",
"FStar.Reflection.V1.Data.binder_view",
"Prims.precedes",
"FStar.Reflection.V1.Builtins.inspect_binder"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *)
let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false
(** Checks if a term `t` is equal to any FV (a top level name) from
those given in the list. Ignores universes and ascriptions. *)
let rec is_any_fvar (t : term) (nms:list string) : bool =
match nms with
| [] -> false
| v::vs -> is_fvar t v || is_any_fvar t vs
let is_uvar (t : term) : bool =
match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val binder_set_qual (q: aqualv) (b: binder) : Tot binder | [] | FStar.Reflection.V1.Derived.binder_set_qual | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | q: FStar.Reflection.V1.Data.aqualv -> b: FStar.Reflection.Types.binder
-> FStar.Reflection.Types.binder | {
"end_col": 40,
"end_line": 217,
"start_col": 56,
"start_line": 215
} |
Prims.Tot | val add_check_with : vconfig -> sigelt -> Tot sigelt | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let add_check_with vcfg se =
let attrs = sigelt_attrs se in
let vcfg_t = embed_vconfig vcfg in
let t = `(check_with (`#vcfg_t)) in
set_sigelt_attrs (t :: attrs) se | val add_check_with : vconfig -> sigelt -> Tot sigelt
let add_check_with vcfg se = | false | null | false | let attrs = sigelt_attrs se in
let vcfg_t = embed_vconfig vcfg in
let t = `(check_with (`#vcfg_t)) in
set_sigelt_attrs (t :: attrs) se | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.VConfig.vconfig",
"FStar.Reflection.Types.sigelt",
"FStar.Reflection.V1.Builtins.set_sigelt_attrs",
"Prims.Cons",
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.embed_vconfig",
"Prims.list",
"FStar.Reflection.V1.Builtins.sigelt_attrs"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)]
let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts)
let mktuple_n (ts : list term{List.Tot.Base.length ts <= 8}) : term =
match List.Tot.Base.length ts with
| 0 -> pack_ln (Tv_Const C_Unit)
| 1 -> let [x] = ts in x
| n -> begin
let qn = match n with
| 2 -> mktuple2_qn
| 3 -> mktuple3_qn
| 4 -> mktuple4_qn
| 5 -> mktuple5_qn
| 6 -> mktuple6_qn
| 7 -> mktuple7_qn
| 8 -> mktuple8_qn
in mk_e_app (pack_ln (Tv_FVar (pack_fv qn))) ts
end
let destruct_tuple (t : term) : option (list term) =
let head, args = collect_app_ln t in
match inspect_ln head with
| Tv_FVar fv ->
if List.Tot.Base.mem
(inspect_fv fv) [mktuple2_qn; mktuple3_qn; mktuple4_qn; mktuple5_qn;
mktuple6_qn; mktuple7_qn; mktuple8_qn]
then Some (List.Tot.Base.concatMap (fun (t, q) ->
match q with
| Q_Explicit -> [t]
| _ -> []) args)
else None
| _ -> None
let mkpair (t1 t2 : term) : term =
mktuple_n [t1;t2]
let rec head (t : term) : term =
match inspect_ln t with
| Tv_Match t _ _
| Tv_Let _ _ _ _ t _
| Tv_Abs _ t
| Tv_Refine _ _ t
| Tv_App t _
| Tv_AscribedT t _ _ _
| Tv_AscribedC t _ _ _ -> head t
| Tv_Unknown
| Tv_Uvar _ _
| Tv_Const _
| Tv_Type _
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _
| Tv_Arrow _ _
| Tv_Unsupp -> t
(** Checks if a term `t` is equal to some FV (a top level name).
Ignores universes and ascriptions. *)
let is_fvar (t : term) (nm:string) : bool =
match inspect_ln_unascribe t with
| Tv_FVar fv
| Tv_UInst fv _ -> implode_qn (inspect_fv fv) = nm
| _ -> false
(** Checks if a term `t` is equal to any FV (a top level name) from
those given in the list. Ignores universes and ascriptions. *)
let rec is_any_fvar (t : term) (nms:list string) : bool =
match nms with
| [] -> false
| v::vs -> is_fvar t v || is_any_fvar t vs
let is_uvar (t : term) : bool =
match inspect_ln (head t) with
| Tv_Uvar _ _ -> true
| _ -> false
let binder_set_qual (q:aqualv) (b:binder) : Tot binder =
let bview = inspect_binder b in
pack_binder {bview with binder_qual=q}
(** Set a vconfig for a sigelt *) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val add_check_with : vconfig -> sigelt -> Tot sigelt | [] | FStar.Reflection.V1.Derived.add_check_with | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | vcfg: FStar.VConfig.vconfig -> se: FStar.Reflection.Types.sigelt -> FStar.Reflection.Types.sigelt | {
"end_col": 34,
"end_line": 225,
"start_col": 28,
"start_line": 221
} |
Prims.Tot | val mk_list (ts: list term) : term | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec mk_list (ts : list term) : term =
match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t::ts -> mk_cons t (mk_list ts) | val mk_list (ts: list term) : term
let rec mk_list (ts: list term) : term = | false | null | false | match ts with
| [] -> pack_ln (Tv_FVar (pack_fv nil_qn))
| t :: ts -> mk_cons t (mk_list ts) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"Prims.list",
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_FVar",
"FStar.Reflection.V1.Builtins.pack_fv",
"FStar.Reflection.Const.nil_qn",
"FStar.Reflection.V1.Derived.mk_cons",
"FStar.Reflection.V1.Derived.mk_list"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod))))
let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end
val collect_arr_ln_bs : typ -> list binder * comp
let collect_arr_ln_bs t =
let (bs, c) = collect_arr' [] (pack_comp (C_Total t)) in
(List.Tot.Base.rev bs, c)
val collect_arr_ln : typ -> list typ * comp
let collect_arr_ln t =
let bs, c = collect_arr_ln_bs t in
List.Tot.Base.map type_of_binder bs, c
let rec collect_abs' (bs : list binder) (t : term) : Tot (list binder * term) (decreases t) =
match inspect_ln_unascribe t with
| Tv_Abs b t' ->
collect_abs' (b::bs) t'
| _ -> (bs, t)
val collect_abs_ln : term -> list binder * term
let collect_abs_ln t =
let (bs, t') = collect_abs' [] t in
(List.Tot.Base.rev bs, t')
let fv_to_string (fv:fv) : string = implode_qn (inspect_fv fv)
let mk_stringlit (s : string) : term =
pack_ln (Tv_Const (C_String s))
let mk_strcat (t1 t2 : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv ["Prims"; "strcat"]))) [t1; t2]
let mk_cons (h t : term) : term =
mk_e_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [h; t]
let mk_cons_t (ty h t : term) : term =
mk_app (pack_ln (Tv_FVar (pack_fv cons_qn))) [(ty, Q_Implicit); (h, Q_Explicit); (t, Q_Explicit)] | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_list (ts: list term) : term | [
"recursion"
] | FStar.Reflection.V1.Derived.mk_list | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | ts: Prims.list FStar.Reflection.Types.term -> FStar.Reflection.Types.term | {
"end_col": 37,
"end_line": 139,
"start_col": 4,
"start_line": 137
} |
Prims.Tot | val mk_tot_arr_ln (bs: list binder) (cod: term) : Tot term (decreases bs) | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod)))) | val mk_tot_arr_ln (bs: list binder) (cod: term) : Tot term (decreases bs)
let rec mk_tot_arr_ln (bs: list binder) (cod: term) : Tot term (decreases bs) = | false | null | false | match bs with
| [] -> cod
| b :: bs -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod)))) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total",
""
] | [
"Prims.list",
"FStar.Reflection.Types.binder",
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_Arrow",
"FStar.Reflection.V1.Builtins.pack_comp",
"FStar.Reflection.V1.Data.C_Total",
"FStar.Reflection.V1.Derived.mk_tot_arr_ln"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_tot_arr_ln (bs: list binder) (cod: term) : Tot term (decreases bs) | [
"recursion"
] | FStar.Reflection.V1.Derived.mk_tot_arr_ln | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | bs: Prims.list FStar.Reflection.Types.binder -> cod: FStar.Reflection.Types.term
-> Prims.Tot FStar.Reflection.Types.term | {
"end_col": 82,
"end_line": 87,
"start_col": 4,
"start_line": 85
} |
Prims.Tot | val inspect_ln_unascribe (t: term) : tv: term_view{tv << t /\ notAscription tv} | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv | val inspect_ln_unascribe (t: term) : tv: term_view{tv << t /\ notAscription tv}
let rec inspect_ln_unascribe (t: term) : tv: term_view{tv << t /\ notAscription tv} = | false | null | false | match inspect_ln t with
| Tv_AscribedT t' _ _ _ | Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V1.Builtins.inspect_ln",
"FStar.Pervasives.Native.option",
"Prims.bool",
"FStar.Reflection.V1.Derived.inspect_ln_unascribe",
"FStar.Reflection.Types.comp",
"FStar.Reflection.V1.Data.term_view",
"Prims.l_and",
"Prims.precedes",
"Prims.b2t",
"FStar.Reflection.V1.Data.notAscription"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv | false | false | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_ln_unascribe (t: term) : tv: term_view{tv << t /\ notAscription tv} | [
"recursion"
] | FStar.Reflection.V1.Derived.inspect_ln_unascribe | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term
-> tv: FStar.Reflection.V1.Data.term_view{tv << t /\ FStar.Reflection.V1.Data.notAscription tv} | {
"end_col": 14,
"end_line": 31,
"start_col": 4,
"start_line": 28
} |
Prims.Tot | val collect_arr' (bs: list binder) (c: comp) : Tot (list binder * comp) (decreases c) | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec collect_arr' (bs : list binder) (c : comp) : Tot (list binder * comp) (decreases c) =
begin match inspect_comp c with
| C_Total t ->
begin match inspect_ln_unascribe t with
| Tv_Arrow b c ->
collect_arr' (b::bs) c
| _ ->
(bs, c)
end
| _ -> (bs, c)
end | val collect_arr' (bs: list binder) (c: comp) : Tot (list binder * comp) (decreases c)
let rec collect_arr' (bs: list binder) (c: comp) : Tot (list binder * comp) (decreases c) = | false | null | false | match inspect_comp c with
| C_Total t ->
(match inspect_ln_unascribe t with
| Tv_Arrow b c -> collect_arr' (b :: bs) c
| _ -> (bs, c))
| _ -> (bs, c) | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total",
""
] | [
"Prims.list",
"FStar.Reflection.Types.binder",
"FStar.Reflection.Types.comp",
"FStar.Reflection.V1.Builtins.inspect_comp",
"FStar.Reflection.Types.typ",
"FStar.Reflection.V1.Derived.inspect_ln_unascribe",
"FStar.Reflection.V1.Derived.collect_arr'",
"Prims.Cons",
"FStar.Reflection.V1.Data.term_view",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.V1.Data.comp_view"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' []
let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs
// Helper for when all arguments are explicit
let mk_e_app (t : term) (args : list term) : Tot term =
let e t = (t, Q_Explicit) in
mk_app t (List.Tot.Base.map e args)
let u_unk : universe = pack_universe Uv_Unk
let rec mk_tot_arr_ln (bs: list binder) (cod : term) : Tot term (decreases bs) =
match bs with
| [] -> cod
| (b::bs) -> pack_ln (Tv_Arrow b (pack_comp (C_Total (mk_tot_arr_ln bs cod)))) | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val collect_arr' (bs: list binder) (c: comp) : Tot (list binder * comp) (decreases c) | [
"recursion"
] | FStar.Reflection.V1.Derived.collect_arr' | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | bs: Prims.list FStar.Reflection.Types.binder -> c: FStar.Reflection.Types.comp
-> Prims.Tot (Prims.list FStar.Reflection.Types.binder * FStar.Reflection.Types.comp) | {
"end_col": 18,
"end_line": 98,
"start_col": 10,
"start_line": 90
} |
Prims.Tot | val mk_app (t: term) (args: list argv) : Tot term (decreases args) | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec mk_app (t : term) (args : list argv) : Tot term (decreases args) =
match args with
| [] -> t
| (x::xs) -> mk_app (pack_ln (Tv_App t x)) xs | val mk_app (t: term) (args: list argv) : Tot term (decreases args)
let rec mk_app (t: term) (args: list argv) : Tot term (decreases args) = | false | null | false | match args with
| [] -> t
| x :: xs -> mk_app (pack_ln (Tv_App t x)) xs | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total",
""
] | [
"FStar.Reflection.Types.term",
"Prims.list",
"FStar.Reflection.V1.Data.argv",
"FStar.Reflection.V1.Derived.mk_app",
"FStar.Reflection.V1.Builtins.pack_ln",
"FStar.Reflection.V1.Data.Tv_App"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string
let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns
(* Helpers for dealing with nested applications and arrows *)
let rec collect_app_ln' (args : list argv) (t : term) : Tot (term * list argv) (decreases t) =
match inspect_ln_unascribe t with
| Tv_App l r ->
collect_app_ln' (r::args) l
| _ -> (t, args)
val collect_app_ln : term -> term * list argv
let collect_app_ln = collect_app_ln' [] | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_app (t: term) (args: list argv) : Tot term (decreases args) | [
"recursion"
] | FStar.Reflection.V1.Derived.mk_app | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> args: Prims.list FStar.Reflection.V1.Data.argv
-> Prims.Tot FStar.Reflection.Types.term | {
"end_col": 49,
"end_line": 75,
"start_col": 4,
"start_line": 73
} |
Prims.Tot | val flatten_name : name -> Tot string | [
{
"abbrev": false,
"full_module": "FStar.VConfig",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Order",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Data",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1.Builtins",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Const",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V1",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec flatten_name ns =
match ns with
| [] -> ""
| [n] -> n
| n::ns -> n ^ "." ^ flatten_name ns | val flatten_name : name -> Tot string
let rec flatten_name ns = | false | null | false | match ns with
| [] -> ""
| [n] -> n
| n :: ns -> n ^ "." ^ flatten_name ns | {
"checked_file": "FStar.Reflection.V1.Derived.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.VConfig.fsti.checked",
"FStar.Reflection.V1.Data.fsti.checked",
"FStar.Reflection.V1.Builtins.fsti.checked",
"FStar.Reflection.Types.fsti.checked",
"FStar.Reflection.Const.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Order.fst.checked",
"FStar.List.Tot.Base.fst.checked"
],
"interface_file": false,
"source_file": "FStar.Reflection.V1.Derived.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.name",
"Prims.string",
"Prims.list",
"Prims.op_Hat",
"FStar.Reflection.V1.Derived.flatten_name"
] | [] | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.V1.Derived
open FStar.Reflection.Types
open FStar.Reflection.Const
open FStar.Reflection.V1.Builtins
open FStar.Reflection.V1.Data
open FStar.Order
open FStar.VConfig
let bv_of_binder (b : binder) : bv = (inspect_binder b).binder_bv
let rec inspect_ln_unascribe (t:term) : tv:term_view{tv << t /\ notAscription tv} =
match inspect_ln t with
| Tv_AscribedT t' _ _ _
| Tv_AscribedC t' _ _ _ -> inspect_ln_unascribe t'
| tv -> tv
(*
* AR: add versions that take attributes as arguments?
*)
let mk_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Explicit;
binder_attrs=[];
binder_sort = sort;
}
let mk_implicit_binder (bv : bv) (sort : typ) : binder =
pack_binder {
binder_bv=bv;
binder_qual=Q_Implicit;
binder_attrs=[];
binder_sort = sort;
}
let type_of_binder (b : binder) : typ =
(inspect_binder b).binder_sort
val flatten_name : name -> Tot string | false | true | FStar.Reflection.V1.Derived.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val flatten_name : name -> Tot string | [
"recursion"
] | FStar.Reflection.V1.Derived.flatten_name | {
"file_name": "ulib/FStar.Reflection.V1.Derived.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | ns: FStar.Reflection.Types.name -> Prims.string | {
"end_col": 40,
"end_line": 60,
"start_col": 4,
"start_line": 57
} |
Subsets and Splits