file_name stringlengths 5 52 | name stringlengths 4 95 | original_source_type stringlengths 0 23k | source_type stringlengths 9 23k | source_definition stringlengths 9 57.9k | source dict | source_range dict | file_context stringlengths 0 721k | dependencies dict | opens_and_abbrevs listlengths 2 94 | vconfig dict | interleaved bool 1
class | verbose_type stringlengths 1 7.42k | effect stringclasses 118
values | effect_flags listlengths 0 2 | mutual_with listlengths 0 11 | ideal_premises listlengths 0 236 | proof_features listlengths 0 1 | is_simple_lemma bool 2
classes | is_div bool 2
classes | is_proof bool 2
classes | is_simply_typed bool 2
classes | is_type bool 2
classes | partial_definition stringlengths 5 3.99k | completed_definiton stringlengths 1 1.63M | isa_cross_project_example bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FStar.Sequence.Base.fst | FStar.Sequence.Base.index_into_drop_helper | val index_into_drop_helper (#ty: Type) (s: list ty) (n j: nat)
: Lemma (requires j < length s - n /\ length (drop s n) = length s - n)
(ensures index (drop s n) j == index s (j + n)) | val index_into_drop_helper (#ty: Type) (s: list ty) (n j: nat)
: Lemma (requires j < length s - n /\ length (drop s n) = length s - n)
(ensures index (drop s n) j == index s (j + n)) | let rec index_into_drop_helper (#ty: Type) (s: list ty) (n: nat) (j: nat)
: Lemma (requires j < length s - n /\ length (drop s n) = length s - n)
(ensures index (drop s n) j == index s (j + n)) =
match s with
| hd :: tl -> if n = 0 then () else index_into_drop_helper tl (n - 1) j | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 73,
"end_line": 474,
"start_col": 8,
"start_line": 470
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: Prims.list ty -> n: Prims.nat -> j: Prims.nat
-> FStar.Pervasives.Lemma
(requires
j < FStar.Sequence.Base.length s - n /\
FStar.Sequence.Base.length (FStar.Sequence.Base.drop s n) = FStar.Sequence.Base.length s - n
)
(ensures
FStar.Sequence.Base.index (FStar.Sequence.Base.... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"Prims.nat",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Sequence.Base.index_into_drop_helper",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Sequence.Base.length",
"FStar.Sequence.Base.drop",
"Prims.squash",
"Prims... | [
"recursion"
] | false | false | true | false | false | let rec index_into_drop_helper (#ty: Type) (s: list ty) (n j: nat)
: Lemma (requires j < length s - n /\ length (drop s n) = length s - n)
(ensures index (drop s n) j == index s (j + n)) =
| match s with | hd :: tl -> if n = 0 then () else index_into_drop_helper tl (n - 1) j | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.drop_then_drop_lemma | val drop_then_drop_lemma: Prims.unit
-> Lemma (requires drop_length_fact u#a) (ensures drop_then_drop_fact u#a ()) | val drop_then_drop_lemma: Prims.unit
-> Lemma (requires drop_length_fact u#a) (ensures drop_then_drop_fact u#a ()) | let drop_then_drop_lemma () : Lemma (requires drop_length_fact u#a) (ensures drop_then_drop_fact u#a ()) =
introduce forall (ty: Type) (s: seq ty) (m: nat) (n: nat).
m + n <= length s ==> drop (drop s m) n == drop s (m + n)
with
introduce _ ==> _
with given_antecedent. (
assert (length (... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 709,
"start_col": 8,
"start_line": 701
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | _: Prims.unit
-> FStar.Pervasives.Lemma (requires FStar.Sequence.Base.drop_length_fact)
(ensures FStar.Sequence.Base.drop_then_drop_fact ()) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"FStar.Classical.Sugar.forall_intro",
"Prims.l_Forall",
"FStar.Sequence.Base.seq",
"Prims.nat",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_Addition",
"FStar.Sequence.Base.length",
"Prims.eq2",
"FStar.Sequence.Base.drop",
"FStar.Classical.Sugar.implies_int... | [] | false | false | true | false | false | let drop_then_drop_lemma ()
: Lemma (requires drop_length_fact u#a) (ensures drop_then_drop_fact u#a ()) =
| introduce forall (ty: Type) (s: seq ty) (m: nat) (n: nat) . m + n <= length s ==>
drop (drop s m) n == drop s (m + n)
with introduce _ ==> _
with given_antecedent. (assert (length (drop s m) = length s - m);
drop_then_drop_helper s m n) | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.drop_ignores_out_of_range_update_helper | val drop_ignores_out_of_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires i < n /\ n <= length s /\ length (update s i v) = length s)
(ensures drop (update s i v) n == drop s n) | val drop_ignores_out_of_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires i < n /\ n <= length s /\ length (update s i v) = length s)
(ensures drop (update s i v) n == drop s n) | let rec drop_ignores_out_of_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires i < n
/\ n <= length s
/\ length (update s i v) = length s)
(ensures drop (update s i v) n == drop s n) =
match s with
| hd :: tl -> if i = 0 th... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 98,
"end_line": 606,
"start_col": 8,
"start_line": 600
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: Prims.list ty -> i: Prims.nat -> v: ty -> n: Prims.nat
-> FStar.Pervasives.Lemma
(requires
i < n /\ n <= FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.update s i v) = FStar.Sequence.Base.length s
)
(ensures
FStar.Sequence.Base.drop (FStar.... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"Prims.nat",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Sequence.Base.drop_ignores_out_of_range_update_helper",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_LessThanOrEqual",
"FStar.Sequence.Base.length",
"FStar.... | [
"recursion"
] | false | false | true | false | false | let rec drop_ignores_out_of_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires i < n /\ n <= length s /\ length (update s i v) = length s)
(ensures drop (update s i v) n == drop s n) =
| match s with
| hd :: tl -> if i = 0 then () else drop_ignores_out_of_range_update_helper tl (i - 1) v (n - 1) | false |
Pulse.Checker.Prover.ElimExists.fst | Pulse.Checker.Prover.ElimExists.should_elim_exists | val should_elim_exists (v: vprop) : T.Tac bool | val should_elim_exists (v: vprop) : T.Tac bool | let should_elim_exists (v:vprop) : T.Tac bool =
match v.t with
| Tm_ExistsSL _ _ _ -> true
| _ -> false | {
"file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimExists.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 14,
"end_line": 33,
"start_col": 0,
"start_line": 30
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.Checker.VPropEquiv.fsti.checked",
"Pulse.Checker.Prover.Base.fsti.checked",
"prims.fst.checked",
"FStar.... | [
{
"abbrev": false,
"full_module": "Pulse.Checker.Prover.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker.VPropEquiv",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": ... | {
"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_el... | false | v: Pulse.Syntax.Base.vprop -> FStar.Tactics.Effect.Tac Prims.bool | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Syntax.Base.vprop",
"Pulse.Syntax.Base.__proj__Mkterm__item__t",
"Pulse.Syntax.Base.universe",
"Pulse.Syntax.Base.binder",
"Pulse.Syntax.Base.term",
"Pulse.Syntax.Base.term'",
"Prims.bool"
] | [] | false | true | false | false | false | let should_elim_exists (v: vprop) : T.Tac bool =
| match v.t with
| Tm_ExistsSL _ _ _ -> true
| _ -> false | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.take_commutes_with_in_range_update_helper | val take_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires i < n /\ n <= length s /\ length (update s i v) = length s /\ length (take s n) = n)
(ensures take (update s i v) n == update (take s n) i v) | val take_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires i < n /\ n <= length s /\ length (update s i v) = length s /\ length (take s n) = n)
(ensures take (update s i v) n == update (take s n) i v) | let rec take_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires i < n
/\ n <= length s
/\ length (update s i v) = length s
/\ length (take s n) = n)
(ensures take (update s i v) n == update ... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 136,
"end_line": 526,
"start_col": 8,
"start_line": 519
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: Prims.list ty -> i: Prims.nat -> v: ty -> n: Prims.nat
-> FStar.Pervasives.Lemma
(requires
i < n /\ n <= FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.update s i v) = FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.take... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"Prims.nat",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Sequence.Base.take_commutes_with_in_range_update_helper",
"Prims.op_Subtraction",
"Prims.unit",
"FStar.Sequence.Base.update_maintains_length_lemma",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Le... | [
"recursion"
] | false | false | true | false | false | let rec take_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires i < n /\ n <= length s /\ length (update s i v) = length s /\ length (take s n) = n)
(ensures take (update s i v) n == update (take s n) i v) =
| match s with
| hd :: tl ->
if i = 0
then ()
else
(update_maintains_length_lemma ();
take_commutes_with_in_range_update_helper tl (i - 1) v (n - 1)) | false |
AlgWP.fst | AlgWP.rwops | val rwops : Type0 | let rwops = labs:ops{sublist labs [Read; Write]} | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 48,
"end_line": 17,
"start_col": 0,
"start_line": 17
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Alg.ops",
"Alg.sublist",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil"
] | [] | false | false | false | true | true | let rwops =
| labs: ops{sublist labs [Read; Write]} | false | |
AlgWP.fst | AlgWP.subops | val subops: rwops -> rwops -> Type0 | val subops: rwops -> rwops -> Type0 | let subops : rwops -> rwops -> Type0 = sublist | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 46,
"end_line": 33,
"start_col": 0,
"start_line": 33
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | _: AlgWP.rwops -> _: AlgWP.rwops -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Alg.sublist"
] | [] | false | false | false | true | true | let subops: rwops -> rwops -> Type0 =
| sublist | false |
AlgWP.fst | AlgWP.sublist_at | val sublist_at (l1 l2: ops)
: Lemma (sublist l1 (l1 @ l2) /\ sublist l2 (l1 @ l2)) [SMTPat (l1 @ l2)] | val sublist_at (l1 l2: ops)
: Lemma (sublist l1 (l1 @ l2) /\ sublist l2 (l1 @ l2)) [SMTPat (l1 @ l2)] | let sublist_at (l1 l2 : ops)
: Lemma (sublist l1 (l1@l2) /\ sublist l2 (l1@l2))
[SMTPat (l1@l2)]
= Alg.sublist_at l1 l2 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 24,
"end_line": 38,
"start_col": 0,
"start_line": 35
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | l1: Alg.ops -> l2: Alg.ops
-> FStar.Pervasives.Lemma (ensures Alg.sublist l1 (l1 @ l2) /\ Alg.sublist l2 (l1 @ l2))
[SMTPat (l1 @ l2)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Alg.ops",
"Alg.sublist_at",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.l_and",
"Alg.sublist",
"FStar.List.Tot.Base.op_At",
"Alg.op",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.list",
"Prims.Nil"
] | [] | true | false | true | false | false | let sublist_at (l1 l2: ops)
: Lemma (sublist l1 (l1 @ l2) /\ sublist l2 (l1 @ l2)) [SMTPat (l1 @ l2)] =
| Alg.sublist_at l1 l2 | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.drop_then_drop_helper | val drop_then_drop_helper (#ty: Type) (s: seq ty) (m n: nat)
: Lemma (requires m + n <= length s /\ length (drop s m) = length s - m)
(ensures drop (drop s m) n == drop s (m + n)) | val drop_then_drop_helper (#ty: Type) (s: seq ty) (m n: nat)
: Lemma (requires m + n <= length s /\ length (drop s m) = length s - m)
(ensures drop (drop s m) n == drop s (m + n)) | let rec drop_then_drop_helper (#ty: Type) (s: seq ty) (m: nat) (n: nat)
: Lemma (requires m + n <= length s /\ length (drop s m) = length s - m)
(ensures drop (drop s m) n == drop s (m + n)) =
match s with
| [] -> ()
| hd :: tl ->
if m = 0
then ()
else (
drop_length_lemma ();
... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 699,
"start_col": 8,
"start_line": 688
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: FStar.Sequence.Base.seq ty -> m: Prims.nat -> n: Prims.nat
-> FStar.Pervasives.Lemma
(requires
m + n <= FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.drop s m) = FStar.Sequence.Base.length s - m
)
(ensures
FStar.Sequence.Base.drop (FStar.S... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Sequence.Base.seq",
"Prims.nat",
"Prims.list",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Sequence.Base.drop_then_drop_helper",
"Prims.op_Subtraction",
"Prims.unit",
"FStar.Sequence.Base.drop_length_lemma",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.o... | [
"recursion"
] | false | false | true | false | false | let rec drop_then_drop_helper (#ty: Type) (s: seq ty) (m n: nat)
: Lemma (requires m + n <= length s /\ length (drop s m) = length s - m)
(ensures drop (drop s m) n == drop s (m + n)) =
| match s with
| [] -> ()
| hd :: tl ->
if m = 0
then ()
else
(drop_length_lemma ();
drop_then_drop_helper tl (m - 1) n) | false |
AlgWP.fst | AlgWP.st_wp | val st_wp : a: Type -> Type | let st_wp (a:Type) = wp:st_wp0 a{st_monotonic wp} | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 49,
"end_line": 57,
"start_col": 0,
"start_line": 57
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> Type | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp0",
"AlgWP.st_monotonic"
] | [] | false | false | false | true | true | let st_wp (a: Type) =
| wp: st_wp0 a {st_monotonic wp} | false | |
AlgWP.fst | AlgWP.st_monotonic | val st_monotonic (#a: _) (w: st_wp0 a) : Type0 | val st_monotonic (#a: _) (w: st_wp0 a) : Type0 | let st_monotonic #a (w : st_wp0 a) : Type0 =
//forall s0 p1 p2. (forall r. p1 r ==> p2 r) ==> w s0 p1 ==> w s0 p2
// ^ this version seems to be less SMT-friendly
forall s0 p1 p2. (forall x s1. p1 (x, s1) ==> p2 (x, s1)) ==> w s0 p1 ==> w s0 p2 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 83,
"end_line": 55,
"start_col": 0,
"start_line": 52
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | w: AlgWP.st_wp0 a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp0",
"Prims.l_Forall",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.logical",
"Prims.l_imp",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | true | true | let st_monotonic #a (w: st_wp0 a) : Type0 =
| forall s0 p1 p2. (forall x s1. p1 (x, s1) ==> p2 (x, s1)) ==> w s0 p1 ==> w s0 p2 | false |
AlgWP.fst | AlgWP.tbind | val tbind: #a: _ -> #b: _ -> #labs1: _ -> #labs2: _ -> rwtree a labs1 -> (a -> rwtree b labs2)
-> rwtree b (labs1 @@ labs2) | val tbind: #a: _ -> #b: _ -> #labs1: _ -> #labs2: _ -> rwtree a labs1 -> (a -> rwtree b labs2)
-> rwtree b (labs1 @@ labs2) | let tbind : #a:_ -> #b:_ ->
#labs1:_ -> #labs2:_ ->
rwtree a labs1 ->
(a -> rwtree b labs2) -> rwtree b (labs1@@labs2) = fun c f -> Alg.bind _ _ c f | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 90,
"end_line": 48,
"start_col": 0,
"start_line": 45
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | c: AlgWP.rwtree a labs1 -> f: (_: a -> AlgWP.rwtree b labs2) -> AlgWP.rwtree b (labs1 @@ labs2) | Prims.Tot | [
"total"
] | [] | [
"Alg.ops",
"Alg.sublist",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.rwtree",
"Alg.bind",
"AlgWP.op_At_At"
] | [] | false | false | false | false | false | let tbind: #a: _ -> #b: _ -> #labs1: _ -> #labs2: _ -> rwtree a labs1 -> (a -> rwtree b labs2)
-> rwtree b (labs1 @@ labs2) =
| fun c f -> Alg.bind _ _ c f | false |
Pulse.Recursion.fst | Pulse.Recursion.map2 | val map2 (#a #b #c: _) (f: (a -> b -> Tac c)) (xs: list a) (ys: list b) : Tac (list c) | val map2 (#a #b #c: _) (f: (a -> b -> Tac c)) (xs: list a) (ys: list b) : Tac (list c) | let rec map2 #a #b #c (f : a -> b -> Tac c) (xs : list a) (ys : list b) : Tac (list c) =
match xs, ys with
| [], [] -> []
| x::xx, y::yy -> f x y :: map2 f xx yy
| _ -> raise Map2_length_mismatch | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 35,
"end_line": 46,
"start_col": 0,
"start_line": 42
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | f: (_: a -> _: b -> FStar.Tactics.Effect.Tac c) -> xs: Prims.list a -> ys: Prims.list b
-> FStar.Tactics.Effect.Tac (Prims.list c) | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.list",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"Prims.Cons",
"Pulse.Recursion.map2",
"FStar.Pervasives.Native.tuple2",
"FStar.Tactics.Effect.raise",
"Pulse.Recursion.Map2_length_mismatch"
] | [
"recursion"
] | false | true | false | false | false | let rec map2 #a #b #c (f: (a -> b -> Tac c)) (xs: list a) (ys: list b) : Tac (list c) =
| match xs, ys with
| [], [] -> []
| x :: xx, y :: yy -> f x y :: map2 f xx yy
| _ -> raise Map2_length_mismatch | false |
Pulse.Recursion.fst | Pulse.Recursion.subst_binder_typ | val subst_binder_typ (s: FStar.Stubs.Syntax.Syntax.subst_t) (b: Tactics.NamedView.binder)
: Tactics.NamedView.binder | val subst_binder_typ (s: FStar.Stubs.Syntax.Syntax.subst_t) (b: Tactics.NamedView.binder)
: Tactics.NamedView.binder | let subst_binder_typ (s : FStar.Stubs.Syntax.Syntax.subst_t) (b : Tactics.NamedView.binder) : Tactics.NamedView.binder =
{ b with sort = FStar.Stubs.Reflection.V2.Builtins.subst_term s b.sort } | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 74,
"end_line": 61,
"start_col": 0,
"start_line": 60
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: FStar.Stubs.Syntax.Syntax.subst_t -> b: FStar.Tactics.NamedView.binder
-> FStar.Tactics.NamedView.binder | Prims.Tot | [
"total"
] | [] | [
"FStar.Stubs.Syntax.Syntax.subst_t",
"FStar.Tactics.NamedView.binder",
"FStar.Tactics.NamedView.Mkbinder",
"FStar.Tactics.NamedView.__proj__Mkbinder__item__uniq",
"FStar.Tactics.NamedView.__proj__Mkbinder__item__ppname",
"FStar.Stubs.Reflection.V2.Builtins.subst_term",
"FStar.Tactics.NamedView.__proj__M... | [] | false | false | false | true | false | let subst_binder_typ (s: FStar.Stubs.Syntax.Syntax.subst_t) (b: Tactics.NamedView.binder)
: Tactics.NamedView.binder =
| { b with sort = FStar.Stubs.Reflection.V2.Builtins.subst_term s b.sort } | false |
Pulse.Recursion.fst | Pulse.Recursion.string_as_term | val string_as_term (s: string) : R.term | val string_as_term (s: string) : R.term | let string_as_term (s:string) : R.term =
R.pack_ln (R.Tv_Const (C_String s)) | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 37,
"end_line": 54,
"start_col": 0,
"start_line": 53
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | s: Prims.string -> FStar.Stubs.Reflection.Types.term | Prims.Tot | [
"total"
] | [] | [
"Prims.string",
"FStar.Stubs.Reflection.V2.Builtins.pack_ln",
"FStar.Stubs.Reflection.V2.Data.Tv_Const",
"FStar.Stubs.Reflection.V2.Data.C_String",
"FStar.Stubs.Reflection.Types.term"
] | [] | false | false | false | true | false | let string_as_term (s: string) : R.term =
| R.pack_ln (R.Tv_Const (C_String s)) | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.drop_commutes_with_in_range_update_helper | val drop_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires
n <= i /\ i < length s /\ length (update s i v) = length s /\
length (drop s n) = length s - n)
(ensures drop (update s i v) n == update (drop s n) (i - n) v) | val drop_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires
n <= i /\ i < length s /\ length (update s i v) = length s /\
length (drop s n) = length s - n)
(ensures drop (update s i v) n == update (drop s n) (i - n) v) | let rec drop_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma (requires n <= i
/\ i < length s
/\ length (update s i v) = length s
/\ length (drop s n) = length s - n)
(ensures drop (update s i v) n... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 582,
"start_col": 8,
"start_line": 567
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 2,
"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_el... | false | s: Prims.list ty -> i: Prims.nat -> v: ty -> n: Prims.nat
-> FStar.Pervasives.Lemma
(requires
n <= i /\ i < FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.update s i v) = FStar.Sequence.Base.length s /\
FStar.Sequence.Base.length (FStar.Sequence.Base.drop... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"Prims.nat",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Sequence.Base.drop_commutes_with_in_range_update_helper",
"Prims.op_Subtraction",
"Prims.unit",
"FStar.Sequence.Base.drop_length_lemma",
"FStar.Sequence.Base.update_maintains_length_lemma",
"Prims.l_and",
"Prims.... | [
"recursion"
] | false | false | true | false | false | let rec drop_commutes_with_in_range_update_helper (#ty: Type) (s: list ty) (i: nat) (v: ty) (n: nat)
: Lemma
(requires
n <= i /\ i < length s /\ length (update s i v) = length s /\
length (drop s n) = length s - n)
(ensures drop (update s i v) n == update (drop s n) (i - n) v) =
| match s with
| hd :: tl ->
if n = 0
then ()
else
(update_maintains_length_lemma ();
drop_length_lemma ();
drop_commutes_with_in_range_update_helper tl (i - 1) v (n - 1)) | false |
AlgWP.fst | AlgWP.stronger | val stronger : (#a:Type) -> st_wp a -> st_wp a -> Type0 | val stronger : (#a:Type) -> st_wp a -> st_wp a -> Type0 | let stronger w1 w2 = forall p s. w1 p s ==> w2 p s | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 50,
"end_line": 95,
"start_col": 0,
"start_line": 95
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | w1: AlgWP.st_wp a -> w2: AlgWP.st_wp a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Prims.l_Forall",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.l_imp"
] | [] | false | false | false | true | true | let stronger w1 w2 =
| forall p s. w1 p s ==> w2 p s | false |
AlgWP.fst | AlgWP.equiv | val equiv : w1: AlgWP.st_wp a -> w2: AlgWP.st_wp a -> Prims.logical | let equiv #a (w1 w2 : st_wp a) = w1 `stronger` w2 /\ w2 `stronger` w1 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 69,
"end_line": 97,
"start_col": 0,
"start_line": 97
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | w1: AlgWP.st_wp a -> w2: AlgWP.st_wp a -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Prims.l_and",
"AlgWP.stronger",
"Prims.logical"
] | [] | false | false | false | true | true | let equiv #a (w1: st_wp a) (w2: st_wp a) =
| w1 `stronger` w2 /\ w2 `stronger` w1 | false | |
AlgWP.fst | AlgWP.wp_is_monotonic | val wp_is_monotonic (#a: _) (wp: st_wp a) : Type0 | val wp_is_monotonic (#a: _) (wp: st_wp a) : Type0 | let wp_is_monotonic #a (wp : st_wp a) : Type0 =
forall p1 p2 s0. (forall x s1. p1 (x, s1) ==> p2 (x, s1)) ==> wp s0 p1 ==> wp s0 p2 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 85,
"end_line": 108,
"start_col": 0,
"start_line": 107
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | wp: AlgWP.st_wp a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Prims.l_Forall",
"FStar.Pervasives.Native.tuple2",
"Alg.state",
"Prims.logical",
"Prims.l_imp",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | true | true | let wp_is_monotonic #a (wp: st_wp a) : Type0 =
| forall p1 p2 s0. (forall x s1. p1 (x, s1) ==> p2 (x, s1)) ==> wp s0 p1 ==> wp s0 p2 | false |
AlgWP.fst | AlgWP.sublist_at_const | val sublist_at_const (l1 l2 l3: ops)
: Lemma (requires (sublist l1 l3 /\ sublist l2 l3))
(ensures (sublist (l1 @ l2) l3))
[SMTPat (sublist (l1 @ l2) l3)] | val sublist_at_const (l1 l2 l3: ops)
: Lemma (requires (sublist l1 l3 /\ sublist l2 l3))
(ensures (sublist (l1 @ l2) l3))
[SMTPat (sublist (l1 @ l2) l3)] | let rec sublist_at_const (l1 l2 l3 : ops)
: Lemma (requires (sublist l1 l3 /\ sublist l2 l3))
(ensures (sublist (l1@l2) l3))
[SMTPat (sublist (l1@l2) l3)]
= match l1 with
| [] -> ()
| h::t -> sublist_at_const t l2 l3 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 30,
"start_col": 0,
"start_line": 24
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | l1: Alg.ops -> l2: Alg.ops -> l3: Alg.ops
-> FStar.Pervasives.Lemma (requires Alg.sublist l1 l3 /\ Alg.sublist l2 l3)
(ensures Alg.sublist (l1 @ l2) l3)
[SMTPat (Alg.sublist (l1 @ l2) l3)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Alg.ops",
"Alg.op",
"Prims.list",
"AlgWP.sublist_at_const",
"Prims.unit",
"Prims.l_and",
"Alg.sublist",
"Prims.squash",
"FStar.List.Tot.Base.op_At",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.logical",
"Prims.Nil"
] | [
"recursion"
] | false | false | true | false | false | let rec sublist_at_const (l1 l2 l3: ops)
: Lemma (requires (sublist l1 l3 /\ sublist l2 l3))
(ensures (sublist (l1 @ l2) l3))
[SMTPat (sublist (l1 @ l2) l3)] =
| match l1 with
| [] -> ()
| h :: t -> sublist_at_const t l2 l3 | false |
FStar.Sequence.Base.fst | FStar.Sequence.Base.drop_contains_equiv_exists_helper1 | val drop_contains_equiv_exists_helper1 (ty: Type) (s: list ty) (n: nat{n <= length s}) (x: ty)
: Lemma (requires FLT.memP x (drop s n))
(ensures (exists (i: nat). {:pattern index s i} n <= i /\ i < length s /\ index s i == x)) | val drop_contains_equiv_exists_helper1 (ty: Type) (s: list ty) (n: nat{n <= length s}) (x: ty)
: Lemma (requires FLT.memP x (drop s n))
(ensures (exists (i: nat). {:pattern index s i} n <= i /\ i < length s /\ index s i == x)) | let rec drop_contains_equiv_exists_helper1 (ty: Type) (s: list ty) (n: nat{n <= length s}) (x: ty)
: Lemma (requires FLT.memP x (drop s n))
(ensures (exists (i: nat).{:pattern index s i} n <= i /\ i < length s /\ index s i == x)) =
match s with
| hd :: tl ->
eliminate n == 0 \/ n <> 0
returns ... | {
"file_name": "ulib/experimental/FStar.Sequence.Base.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 99,
"end_line": 370,
"start_col": 8,
"start_line": 349
} | (*
Copyright 2008-2021 Jay Lorch, Rustan Leino, Alex Summers, Dan
Rosen, Nikhil Swamy, Microsoft Research, and contributors to
the Dafny Project
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 th... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.Properties.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": true,
"source_file": "F... | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "FLT"
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 1,
"initial_ifuel": 1,
"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_el... | false | ty: Type -> s: Prims.list ty -> n: Prims.nat{n <= FStar.Sequence.Base.length s} -> x: ty
-> FStar.Pervasives.Lemma (requires FStar.List.Tot.Base.memP x (FStar.Sequence.Base.drop s n))
(ensures
exists (i: Prims.nat). {:pattern FStar.Sequence.Base.index s i}
n <= i /\ i < FStar.Sequence.Base.len... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Sequence.Base.length",
"FStar.Classical.Sugar.or_elim",
"Prims.eq2",
"Prims.int",
"Prims.squash",
"Prims.l_not",
"Prims.op_disEquality",
"Prims.l_Exists",
"Prims.l_and",
"Prims.op_LessThan",
"FStar.Sequence.Base.i... | [
"recursion"
] | false | false | true | false | false | let rec drop_contains_equiv_exists_helper1 (ty: Type) (s: list ty) (n: nat{n <= length s}) (x: ty)
: Lemma (requires FLT.memP x (drop s n))
(ensures (exists (i: nat). {:pattern index s i} n <= i /\ i < length s /\ index s i == x)) =
| match s with
| hd :: tl ->
eliminate n == 0 \/ n <> 0
returns exists (i: nat). {:pattern index s i} n <= i /\ i < length s /\ index s i == x
with case_n_eq_0 . (eliminate x == hd \/ ~(x == hd)
returns _
with _ . assert (index s 0 == x)
and _ . (drop_contains_equiv_exists_helper1 ty tl n x;
elimi... | false |
AlgWP.fst | AlgWP.noops | val noops:rwops | val noops:rwops | let noops : rwops = [] | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 22,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | AlgWP.rwops | Prims.Tot | [
"total"
] | [] | [
"Prims.Nil",
"Alg.op"
] | [] | false | false | false | true | false | let noops:rwops =
| [] | false |
AlgWP.fst | AlgWP.read_wp | val read_wp:st_wp state | val read_wp:st_wp state | let read_wp : st_wp state = fun s0 p -> p (s0, s0) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 50,
"end_line": 68,
"start_col": 0,
"start_line": 68
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | AlgWP.st_wp Alg.state | Prims.Tot | [
"total"
] | [] | [
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | true | false | let read_wp:st_wp state =
| fun s0 p -> p (s0, s0) | false |
AlgWP.fst | AlgWP.bind_wp | val bind_wp (#a #b: _) (w: st_wp a) (wf: (a -> st_wp b)) : st_wp b | val bind_wp (#a #b: _) (w: st_wp a) (wf: (a -> st_wp b)) : st_wp b | let bind_wp #a #b (w : st_wp a) (wf : a -> st_wp b)
: st_wp b
= fun s0 p -> w s0 (fun (y, s1) -> wf y s1 p) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 47,
"end_line": 65,
"start_col": 0,
"start_line": 63
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | w: AlgWP.st_wp a -> wf: (_: a -> AlgWP.st_wp b) -> AlgWP.st_wp b | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Alg.state",
"FStar.Pervasives.Native.tuple2"
] | [] | false | false | false | true | false | let bind_wp #a #b (w: st_wp a) (wf: (a -> st_wp b)) : st_wp b =
| fun s0 p -> w s0 (fun (y, s1) -> wf y s1 p) | false |
AlgWP.fst | AlgWP.write_wp | val write_wp: state -> st_wp unit | val write_wp: state -> st_wp unit | let write_wp : state -> st_wp unit = fun s _ p -> p ((), s) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 59,
"end_line": 71,
"start_col": 0,
"start_line": 71
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | s: Alg.state -> AlgWP.st_wp Prims.unit | Prims.Tot | [
"total"
] | [] | [
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.unit",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | true | false | let write_wp: state -> st_wp unit =
| fun s _ p -> p ((), s) | false |
AlgWP.fst | AlgWP.interp_as_wp | val interp_as_wp (#a: _) (t: Alg.tree a [Read; Write]) : st_wp a | val interp_as_wp (#a: _) (t: Alg.tree a [Read; Write]) : st_wp a | let rec interp_as_wp #a (t : Alg.tree a [Read;Write]) : st_wp a =
match t with
| Return x -> return_wp x
| Op Read _ k ->
bind_wp read_wp (fun s -> interp_as_wp (k s))
| Op Write s k ->
bind_wp (write_wp s) (fun (o:unit) -> interp_as_wp (k o)) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 61,
"end_line": 80,
"start_col": 0,
"start_line": 74
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | t: Alg.tree a [Alg.Read; Alg.Write] -> AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"Alg.tree",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.return_wp",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.bind_wp",
"Alg.state",
"AlgWP.read_wp",
"AlgWP.interp_as_wp",
"AlgWP.st_wp",
"Prims.unit",
"AlgWP.write_wp"
] | [
"recursion"
] | false | false | false | true | false | let rec interp_as_wp #a (t: Alg.tree a [Read; Write]) : st_wp a =
| match t with
| Return x -> return_wp x
| Op Read _ k -> bind_wp read_wp (fun s -> interp_as_wp (k s))
| Op Write s k -> bind_wp (write_wp s) (fun (o: unit) -> interp_as_wp (k o)) | false |
Hacl.Impl.Ed25519.Ladder.fst | Hacl.Impl.Ed25519.Ladder.point_mul | val point_mul:
out:point
-> scalar:lbuffer uint8 32ul
-> q:point ->
Stack unit
(requires fun h ->
live h scalar /\ live h q /\ live h out /\
disjoint q out /\ disjoint q scalar /\
F51.point_inv_t h q /\ F51.inv_ext_point (as_seq h q))
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
F5... | val point_mul:
out:point
-> scalar:lbuffer uint8 32ul
-> q:point ->
Stack unit
(requires fun h ->
live h scalar /\ live h q /\ live h out /\
disjoint q out /\ disjoint q scalar /\
F51.point_inv_t h q /\ F51.inv_ext_point (as_seq h q))
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
F5... | let point_mul out scalar q =
let h0 = ST.get () in
SE.exp_fw_lemma S.mk_ed25519_concrete_ops
(F51.point_eval h0 q) 256 (BSeq.nat_from_bytes_le (as_seq h0 scalar)) 4;
push_frame ();
let bscalar = create 4ul (u64 0) in
convert_scalar scalar bscalar;
point_mul_noalloc out bscalar q;
pop_frame () | {
"file_name": "code/ed25519/Hacl.Impl.Ed25519.Ladder.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 14,
"end_line": 96,
"start_col": 0,
"start_line": 88
} | module Hacl.Impl.Ed25519.Ladder
module ST = FStar.HyperStack.ST
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Hacl.Bignum25519
module F51 = Hacl.Impl.Ed25519.Field51
module BSeq = Lib.ByteSequence
module LE = Lib.Exponentiation
module SE = Spec.Exponentiation
module BE = Hacl.Impl... | {
"checked_file": "/",
"dependencies": [
"Spec.Exponentiation.fsti.checked",
"Spec.Ed25519.Lemmas.fsti.checked",
"Spec.Ed25519.fst.checked",
"prims.fst.checked",
"LowStar.Ignore.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Exponentiation.fsti.checked",
"Lib.ByteSequence.fsti.chec... | [
{
"abbrev": false,
"full_module": "Hacl.Ed25519.PrecompTable",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Ed25519.Group",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Ed25519.PointConstants",
"short_module": null
},
{
... | {
"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_el... | false |
out: Hacl.Bignum25519.point ->
scalar: Lib.Buffer.lbuffer Lib.IntTypes.uint8 32ul ->
q: Hacl.Bignum25519.point
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Bignum25519.point",
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint8",
"FStar.UInt32.__uint_to_t",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Hacl.Impl.Ed25519.Ladder.point_mul_noalloc",
"Hacl.Impl.Ed25519.Ladder.convert_scalar",
"Lib.Buffer.lbuffer_t",
"Lib.Buffer.MUT",
"Lib.IntTypes.int_t"... | [] | false | true | false | false | false | let point_mul out scalar q =
| let h0 = ST.get () in
SE.exp_fw_lemma S.mk_ed25519_concrete_ops
(F51.point_eval h0 q)
256
(BSeq.nat_from_bytes_le (as_seq h0 scalar))
4;
push_frame ();
let bscalar = create 4ul (u64 0) in
convert_scalar scalar bscalar;
point_mul_noalloc out bscalar q;
pop_frame () | false |
AlgWP.fst | AlgWP.interp_as_wp2 | val interp_as_wp2 (#a #l: _) (t: rwtree a l) : Alg (st_wp a) [] | val interp_as_wp2 (#a #l: _) (t: rwtree a l) : Alg (st_wp a) [] | let interp_as_wp2 #a #l (t : rwtree a l) : Alg (st_wp a) [] =
let t0 : Alg.tree a [Read; Write] = t in
handle_with #a #(st_wp a) #[Read; Write] #[]
(fun () -> Alg?.reflect t0)
(fun x -> return_wp x)
(function Read -> (fun i k -> bind_wp read_wp (fun s -> run (fun () -> k s... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 84,
"end_line": 89,
"start_col": 0,
"start_line": 83
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | t: AlgWP.rwtree a l -> Alg.Alg (AlgWP.st_wp a) | Alg.Alg | [] | [] | [
"Alg.ops",
"Alg.sublist",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.rwtree",
"Alg.handle_with",
"AlgWP.st_wp",
"Prims.unit",
"AlgWP.return_wp",
"FStar.List.Tot.Base.memP",
"Alg.op_inp",
"Alg.op_out",
"AlgWP.bind_wp",
"Alg.state",
"AlgWP.read_wp",
"Alg.r... | [] | false | true | false | false | false | let interp_as_wp2 #a #l (t: rwtree a l) : Alg (st_wp a) [] =
| let t0:Alg.tree a [Read; Write] = t in
handle_with #a
#(st_wp a)
#[Read; Write]
#[]
(fun () -> Alg?.reflect t0)
(fun x -> return_wp x)
(function
| Read -> (fun i k -> bind_wp read_wp (fun s -> run (fun () -> k s)))
| Write -> (fun i k -> bind_wp (write_wp i) (fun _ -> run k))) | false |
AlgWP.fst | AlgWP.interp_ret' | val interp_ret' (#a:Type) (x:a) : Lemma (return_wp x == interp_as_wp (Return x)) | val interp_ret' (#a:Type) (x:a) : Lemma (return_wp x == interp_as_wp (Return x)) | let interp_ret' x = assert_norm (return_wp x == interp_as_wp (Return x)) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 72,
"end_line": 105,
"start_col": 0,
"start_line": 105
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | x: a -> FStar.Pervasives.Lemma (ensures AlgWP.return_wp x == AlgWP.interp_as_wp (Alg.Return x)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"AlgWP.st_wp",
"AlgWP.return_wp",
"AlgWP.interp_as_wp",
"Alg.Return",
"Prims.unit"
] | [] | true | false | true | false | false | let interp_ret' x =
| assert_norm (return_wp x == interp_as_wp (Return x)) | false |
AlgWP.fst | AlgWP.repr | val repr : a: Type -> l: AlgWP.rwops -> w: AlgWP.st_wp a -> Type | let repr (a : Type) (l : rwops) (w: st_wp a) = c:(rwtree a l){w `stronger` interp_as_wp c} | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 90,
"end_line": 183,
"start_col": 0,
"start_line": 183
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> l: AlgWP.rwops -> w: AlgWP.st_wp a -> Type | Prims.Tot | [
"total"
] | [] | [
"AlgWP.rwops",
"AlgWP.st_wp",
"AlgWP.rwtree",
"AlgWP.stronger",
"AlgWP.interp_as_wp"
] | [] | false | false | false | true | true | let repr (a: Type) (l: rwops) (w: st_wp a) =
| c: (rwtree a l){w `stronger` (interp_as_wp c)} | false | |
AlgWP.fst | AlgWP.bind | val bind
(a b: Type)
(#l1: rwops)
(#wp_v: st_wp a)
(#l2: rwops)
(#wp_f: (a -> st_wp b))
(v: repr a l1 wp_v)
(f: (x: a -> repr b l2 (wp_f x)))
: repr b (l1 @@ l2) (bind_wp wp_v wp_f) | val bind
(a b: Type)
(#l1: rwops)
(#wp_v: st_wp a)
(#l2: rwops)
(#wp_f: (a -> st_wp b))
(v: repr a l1 wp_v)
(f: (x: a -> repr b l2 (wp_f x)))
: repr b (l1 @@ l2) (bind_wp wp_v wp_f) | let bind (a : Type) (b : Type)
(#l1 : rwops) (#wp_v : st_wp a)
(#l2 : rwops) (#wp_f: a -> st_wp b)
(v : repr a l1 wp_v) (f : (x:a -> repr b l2 (wp_f x)))
: repr b (l1@@l2) (bind_wp wp_v wp_f)
= interp_bind v f wp_v wp_f;
tbind v f | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 195,
"start_col": 0,
"start_line": 189
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> b: Type -> v: AlgWP.repr a l1 wp_v -> f: (x: a -> AlgWP.repr b l2 (wp_f x))
-> AlgWP.repr b (l1 @@ l2) (AlgWP.bind_wp wp_v wp_f) | Prims.Tot | [
"total"
] | [] | [
"AlgWP.rwops",
"AlgWP.st_wp",
"AlgWP.repr",
"AlgWP.tbind",
"Prims.unit",
"AlgWP.interp_bind",
"AlgWP.op_At_At",
"AlgWP.bind_wp"
] | [] | false | false | false | false | false | let bind
(a b: Type)
(#l1: rwops)
(#wp_v: st_wp a)
(#l2: rwops)
(#wp_f: (a -> st_wp b))
(v: repr a l1 wp_v)
(f: (x: a -> repr b l2 (wp_f x)))
: repr b (l1 @@ l2) (bind_wp wp_v wp_f) =
| interp_bind v f wp_v wp_f;
tbind v f | false |
Pulse.Checker.Prover.ElimExists.fst | Pulse.Checker.Prover.ElimExists.elim_exists_frame | val elim_exists_frame
(#g: env)
(#ctxt #frame: vprop)
(ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop)
(uvs: env{disjoint uvs g})
: T.Tac
(g': env{env_extends g' g /\ disjoint uvs g'} &
ctxt': term &
tot_typing g' (ctxt' * frame) tm_vprop &
continuation_elabora... | val elim_exists_frame
(#g: env)
(#ctxt #frame: vprop)
(ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop)
(uvs: env{disjoint uvs g})
: T.Tac
(g': env{env_extends g' g /\ disjoint uvs g'} &
ctxt': term &
tot_typing g' (ctxt' * frame) tm_vprop &
continuation_elabora... | let elim_exists_frame (#g:env) (#ctxt #frame:vprop)
(ctxt_frame_typing:tot_typing g (ctxt * frame) tm_vprop)
(uvs:env { disjoint uvs g })
: T.Tac (g':env { env_extends g' g /\ disjoint uvs g' } &
ctxt':term &
tot_typing g' (ctxt' * frame) tm_vprop &
continuation_elaborator g (ctxt... | {
"file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimExists.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 55,
"end_line": 58,
"start_col": 0,
"start_line": 51
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.Checker.VPropEquiv.fsti.checked",
"Pulse.Checker.Prover.Base.fsti.checked",
"prims.fst.checked",
"FStar.... | [
{
"abbrev": false,
"full_module": "Pulse.Checker.Prover.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker.VPropEquiv",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": ... | {
"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_el... | false |
ctxt_frame_typing: Pulse.Typing.tot_typing g (ctxt * frame) Pulse.Syntax.Base.tm_vprop ->
uvs: Pulse.Typing.Env.env{Pulse.Typing.Env.disjoint uvs g}
-> FStar.Tactics.Effect.Tac
(FStar.Pervasives.dtuple4 (g':
Pulse.Typing.Env.env
{Pulse.Typing.Env.env_extends g' g /\ Pulse.Typing.Env... | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Typing.Env.env",
"Pulse.Syntax.Base.vprop",
"Pulse.Typing.tot_typing",
"Pulse.Checker.Prover.Base.op_Star",
"Pulse.Syntax.Base.tm_vprop",
"Pulse.Typing.Env.disjoint",
"Pulse.Checker.Prover.Base.add_elims",
"Pulse.Checker.Prover.ElimExists.should_elim_exists",
"Pulse.Checker.Prover.ElimExists.... | [] | false | true | false | false | false | let elim_exists_frame
(#g: env)
(#ctxt #frame: vprop)
(ctxt_frame_typing: tot_typing g (ctxt * frame) tm_vprop)
(uvs: env{disjoint uvs g})
: T.Tac
(g': env{env_extends g' g /\ disjoint uvs g'} &
ctxt': term &
tot_typing g' (ctxt' * frame) tm_vprop &
continuation_elabora... | add_elims should_elim_exists mk ctxt_frame_typing uvs | false |
AlgWP.fst | AlgWP.subcomp | val subcomp (a: Type) (#l1: rwops) (#w1: st_wp a) (#l2: rwops) (#w2: st_wp a) (f: repr a l1 w1)
: Pure (repr a l2 w2) (requires w2 `stronger` w1 /\ l1 `subops` l2) (ensures fun _ -> True) | val subcomp (a: Type) (#l1: rwops) (#w1: st_wp a) (#l2: rwops) (#w2: st_wp a) (f: repr a l1 w1)
: Pure (repr a l2 w2) (requires w2 `stronger` w1 /\ l1 `subops` l2) (ensures fun _ -> True) | let subcomp (a:Type) (#l1 : rwops) (#w1 : st_wp a) (#l2 : rwops) (#w2: st_wp a)
(f : repr a l1 w1)
: Pure (repr a l2 w2)
(requires w2 `stronger` w1 /\ l1 `subops` l2)
(ensures fun _ -> True)
= f | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 202,
"start_col": 0,
"start_line": 197
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> f: AlgWP.repr a l1 w1 -> Prims.Pure (AlgWP.repr a l2 w2) | Prims.Pure | [] | [] | [
"AlgWP.rwops",
"AlgWP.st_wp",
"AlgWP.repr",
"Prims.l_and",
"AlgWP.stronger",
"AlgWP.subops",
"Prims.l_True"
] | [] | false | false | false | false | false | let subcomp (a: Type) (#l1: rwops) (#w1: st_wp a) (#l2: rwops) (#w2: st_wp a) (f: repr a l1 w1)
: Pure (repr a l2 w2) (requires w2 `stronger` w1 /\ l1 `subops` l2) (ensures fun _ -> True) =
| f | false |
AlgWP.fst | AlgWP.is_mono | val is_mono (#a: _) (w: st_wp a) : Type0 | val is_mono (#a: _) (w: st_wp a) : Type0 | let is_mono #a (w : st_wp a) : Type0 = forall s0 p1 p2. (forall x. p1 x ==> p2 x) ==> w s0 p1 ==> w s0 p2 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 105,
"end_line": 274,
"start_col": 0,
"start_line": 274
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | w: AlgWP.st_wp a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Prims.l_Forall",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.logical",
"Prims.l_imp"
] | [] | false | false | false | true | true | let is_mono #a (w: st_wp a) : Type0 =
| forall s0 p1 p2. (forall x. p1 x ==> p2 x) ==> w s0 p1 ==> w s0 p2 | false |
AlgWP.fst | AlgWP.interp_monotonic | val interp_monotonic (#a #l: _) (c: rwtree a l) : Lemma (wp_is_monotonic (interp_as_wp c)) | val interp_monotonic (#a #l: _) (c: rwtree a l) : Lemma (wp_is_monotonic (interp_as_wp c)) | let rec interp_monotonic #a #l (c:rwtree a l) : Lemma (wp_is_monotonic (interp_as_wp c)) =
match c with
| Return x -> ()
| Op Read _ k ->
let aux (x:state) : Lemma (wp_is_monotonic (interp_as_wp (k x))) =
interp_monotonic #_ #l (k x)
in
Classical.forall_intro aux;
bind_preserves_mon read_wp ... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 65,
"end_line": 129,
"start_col": 0,
"start_line": 115
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | c: AlgWP.rwtree a l -> FStar.Pervasives.Lemma (ensures AlgWP.wp_is_monotonic (AlgWP.interp_as_wp c)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Alg.ops",
"Alg.sublist",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.rwtree",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.bind_preserves_mon",
"Alg.state",
"AlgWP.read_wp",
"AlgWP.interp_as_wp",
"AlgWP.st_wp",
"Prims.unit",
"FStar.Classical.forall_intr... | [
"recursion"
] | false | false | true | false | false | let rec interp_monotonic #a #l (c: rwtree a l) : Lemma (wp_is_monotonic (interp_as_wp c)) =
| match c with
| Return x -> ()
| Op Read _ k ->
let aux (x: state) : Lemma (wp_is_monotonic (interp_as_wp (k x))) =
interp_monotonic #_ #l (k x)
in
Classical.forall_intro aux;
bind_preserves_mon read_wp (fun x -> interp_as_wp (k x))
| Op Write s k ->
let aux (x: unit) : Lemma (wp_is_monotonic (interp_as_wp... | false |
AlgWP.fst | AlgWP.is_ro | val is_ro (#a: _) (w: st_wp a) : Type0 | val is_ro (#a: _) (w: st_wp a) : Type0 | let is_ro #a (w : st_wp a) : Type0 =
quotient_ro w `stronger` w | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 277,
"start_col": 0,
"start_line": 276
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | w: AlgWP.st_wp a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"AlgWP.stronger",
"AlgWP.quotient_ro"
] | [] | false | false | false | true | true | let is_ro #a (w: st_wp a) : Type0 =
| (quotient_ro w) `stronger` w | false |
AlgWP.fst | AlgWP.lift_pure_wp | val lift_pure_wp (#a: Type) (wp: pure_wp a) : st_wp a | val lift_pure_wp (#a: Type) (wp: pure_wp a) : st_wp a | let lift_pure_wp (#a:Type) (wp : pure_wp a) : st_wp a =
FStar.Monotonic.Pure.elim_pure_wp_monotonicity wp;
fun s0 p -> wp (fun x -> p (x, s0)) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 37,
"end_line": 230,
"start_col": 0,
"start_line": 228
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | wp: Prims.pure_wp a -> AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"Prims.pure_wp",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.l_True",
"FStar.Pervasives.Native.Mktuple2",
"Prims.pure_pre",
"Prims.unit",
"FStar.Monotonic.Pure.elim_pure_wp_monotonicity",
"AlgWP.st_wp"
] | [] | false | false | false | true | false | let lift_pure_wp (#a: Type) (wp: pure_wp a) : st_wp a =
| FStar.Monotonic.Pure.elim_pure_wp_monotonicity wp;
fun s0 p -> wp (fun x -> p (x, s0)) | false |
Pulse.Checker.Prover.ElimExists.fst | Pulse.Checker.Prover.ElimExists.elim_exists | val elim_exists (#g:env) (#ctxt:term) (ctxt_typing:tot_typing g ctxt tm_vprop)
: T.Tac (g':env { env_extends g' g } &
ctxt':term &
tot_typing g' ctxt' tm_vprop &
continuation_elaborator g ctxt g' ctxt') | val elim_exists (#g:env) (#ctxt:term) (ctxt_typing:tot_typing g ctxt tm_vprop)
: T.Tac (g':env { env_extends g' g } &
ctxt':term &
tot_typing g' ctxt' tm_vprop &
continuation_elaborator g ctxt g' ctxt') | let elim_exists (#g:env) (#ctxt:term)
(ctxt_typing:tot_typing g ctxt tm_vprop)
: T.Tac (g':env { env_extends g' g } &
ctxt':term &
tot_typing g' ctxt' tm_vprop &
continuation_elaborator g ctxt g' ctxt') =
let ctxt_emp_typing : tot_typing g (tm_star ctxt tm_emp) tm_vprop = RU.magi... | {
"file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimExists.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 62,
"end_line": 72,
"start_col": 0,
"start_line": 60
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.Checker.VPropEquiv.fsti.checked",
"Pulse.Checker.Prover.Base.fsti.checked",
"prims.fst.checked",
"FStar.... | [
{
"abbrev": false,
"full_module": "Pulse.Checker.Prover.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker.VPropEquiv",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": ... | {
"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_el... | false | ctxt_typing: Pulse.Typing.tot_typing g ctxt Pulse.Syntax.Base.tm_vprop
-> FStar.Tactics.Effect.Tac
(FStar.Pervasives.dtuple4 (g': Pulse.Typing.Env.env{Pulse.Typing.Env.env_extends g' g})
(fun _ -> Pulse.Syntax.Base.term)
(fun g' ctxt' -> Pulse.Typing.tot_typing g' ctxt' Pulse.Syntax.Base.tm_vprop)... | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Typing.Env.env",
"Pulse.Syntax.Base.term",
"Pulse.Typing.tot_typing",
"Pulse.Syntax.Base.tm_vprop",
"Prims.l_and",
"Pulse.Typing.Env.env_extends",
"Pulse.Typing.Env.disjoint",
"Pulse.Typing.Env.mk_env",
"Pulse.Typing.Env.fstar_env",
"Pulse.Checker.Prover.Base.op_Star",
"Pulse.Syntax.Base.... | [] | false | true | false | false | false | let elim_exists (#g: env) (#ctxt: term) (ctxt_typing: tot_typing g ctxt tm_vprop)
: T.Tac
(g': env{env_extends g' g} &
ctxt': term &
tot_typing g' ctxt' tm_vprop &
continuation_elaborator g ctxt g' ctxt') =
| let ctxt_emp_typing:tot_typing g (tm_star ctxt tm_emp) tm_vprop = RU.magic () in
let (| g' , ctxt' , ctxt'_emp_typing , k |) =
elim_exists_frame ctxt_emp_typing (mk_env (fstar_env g))
in
let k =
k_elab_equiv k
(VE_Trans _ _ _ _ (VE_Comm _ _ _) (VE_Unit _ _))
(VE_Trans _ _ _ _ (VE_Comm _ _ _) (VE_Unit _ _))
... | false |
AlgWP.fst | AlgWP.get | val get: Prims.unit -> AlgWP state [Read] read_wp | val get: Prims.unit -> AlgWP state [Read] read_wp | let get () : AlgWP state [Read] read_wp =
AlgWP?.reflect (Op Read () Return) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 222,
"start_col": 0,
"start_line": 221
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | _: Prims.unit -> AlgWP.AlgWP Alg.state | AlgWP.AlgWP | [] | [] | [
"Prims.unit",
"Alg.Op",
"Alg.state",
"Alg.Read",
"Alg.Return",
"Prims.Cons",
"Alg.op",
"Prims.Nil",
"AlgWP.read_wp"
] | [] | false | true | false | false | false | let get () : AlgWP state [Read] read_wp =
| AlgWP?.reflect (Op Read () Return) | false |
AlgWP.fst | AlgWP.return | val return (a: Type) (x: a) : repr a noops (return_wp x) | val return (a: Type) (x: a) : repr a noops (return_wp x) | let return (a:Type) (x:a) : repr a noops (return_wp x) =
interp_ret #_ #[] x;
Return x | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 10,
"end_line": 187,
"start_col": 0,
"start_line": 185
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> x: a -> AlgWP.repr a AlgWP.noops (AlgWP.return_wp x) | Prims.Tot | [
"total"
] | [] | [
"Alg.Return",
"Prims.unit",
"AlgWP.interp_ret",
"Prims.Nil",
"Alg.op",
"AlgWP.repr",
"AlgWP.noops",
"AlgWP.return_wp"
] | [] | false | false | false | false | false | let return (a: Type) (x: a) : repr a noops (return_wp x) =
| interp_ret #_ #[] x;
Return x | false |
AlgWP.fst | AlgWP.interp_bind | val interp_bind (#a #b:Type) (#l1 #l2 : rwops)
(c : rwtree a l1) (f : a -> rwtree b l2)
(w1 : st_wp a) (w2 : a -> st_wp b)
: Lemma (requires w1 <<= interp_as_wp c /\ (forall x. w2 x <<= interp_as_wp (f x)))
(ensures bind_wp w1 w2 `stronger` interp_as_wp (tbind c f)) | val interp_bind (#a #b:Type) (#l1 #l2 : rwops)
(c : rwtree a l1) (f : a -> rwtree b l2)
(w1 : st_wp a) (w2 : a -> st_wp b)
: Lemma (requires w1 <<= interp_as_wp c /\ (forall x. w2 x <<= interp_as_wp (f x)))
(ensures bind_wp w1 w2 `stronger` interp_as_wp (tbind c f)) | let interp_bind #a #b c f w1 w2 =
let aux (p: (b & state -> Type0)) (s0:state) : Lemma (bind_wp w1 w2 s0 p ==> interp_as_wp (tbind c f) s0 p) =
calc (==>) {
bind_wp w1 w2 s0 p;
==> {}
w1 s0 (fun (y, s1) -> w2 y s1 p);
==> { (* hyp *)}
interp_as_wp c s0 (fun (y, s1) -> w2 y s1 p);
... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 181,
"start_col": 0,
"start_line": 167
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false |
c: AlgWP.rwtree a l1 ->
f: (_: a -> AlgWP.rwtree b l2) ->
w1: AlgWP.st_wp a ->
w2: (_: a -> AlgWP.st_wp b)
-> FStar.Pervasives.Lemma
(requires w1 <<= AlgWP.interp_as_wp c /\ (forall (x: a). w2 x <<= AlgWP.interp_as_wp (f x)))
(ensures AlgWP.stronger (AlgWP.bind_wp w1 w2) (AlgWP.interp_as_... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"AlgWP.rwops",
"AlgWP.rwtree",
"AlgWP.st_wp",
"FStar.Classical.forall_intro_2",
"FStar.Pervasives.Native.tuple2",
"Alg.state",
"Prims.l_imp",
"AlgWP.bind_wp",
"AlgWP.interp_as_wp",
"AlgWP.tbind",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.Nil",
"FStar.Pervasives.pattern",
"FS... | [] | false | false | true | false | false | let interp_bind #a #b c f w1 w2 =
| let aux (p: ((b & state) -> Type0)) (s0: state)
: Lemma (bind_wp w1 w2 s0 p ==> interp_as_wp (tbind c f) s0 p) =
calc ( ==> ) {
bind_wp w1 w2 s0 p;
( ==> ) { () }
w1 s0 (fun (y, s1) -> w2 y s1 p);
( ==> ) { () }
interp_as_wp c s0 (fun (y, s1) -> w2 y s1 p);
( ==> ) { interp_monotonic c }
... | false |
Pulse.Recursion.fst | Pulse.Recursion.freshen_binders | val freshen_binders (bs: binders) : Tot binders (decreases length bs) | val freshen_binders (bs: binders) : Tot binders (decreases length bs) | let rec freshen_binders (bs:binders) : Tot binders (decreases length bs) =
match bs with
| [] -> []
| b::bs ->
let b' = freshen_binder b in
let bs = map (subst_binder_typ [Stubs.Syntax.Syntax.NT (binder_to_namedv b |> FStar.Stubs.Reflection.V2.Builtins.pack_namedv)
... | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 28,
"end_line": 70,
"start_col": 0,
"start_line": 63
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | bs: FStar.Tactics.NamedView.binders -> Prims.Tot FStar.Tactics.NamedView.binders | Prims.Tot | [
"total",
""
] | [] | [
"FStar.Tactics.NamedView.binders",
"Prims.Nil",
"FStar.Tactics.NamedView.binder",
"Prims.list",
"Prims.Cons",
"Pulse.Recursion.freshen_binders",
"FStar.List.Tot.Base.map",
"Pulse.Recursion.subst_binder_typ",
"FStar.Stubs.Syntax.Syntax.subst_elt",
"FStar.Stubs.Syntax.Syntax.NT",
"FStar.Stubs.Refl... | [
"recursion"
] | false | false | false | true | false | let rec freshen_binders (bs: binders) : Tot binders (decreases length bs) =
| match bs with
| [] -> []
| b :: bs ->
let b' = freshen_binder b in
let bs =
map (subst_binder_typ [
Stubs.Syntax.Syntax.NT
(binder_to_namedv b |> FStar.Stubs.Reflection.V2.Builtins.pack_namedv)
(binder_to_term b')
])
bs
in
b' :: freshen_binders bs | false |
Pulse.Recursion.fst | Pulse.Recursion.splitlast | val splitlast (#a: _) (l: list a) : Tac (list a & a) | val splitlast (#a: _) (l: list a) : Tac (list a & a) | let rec splitlast #a (l : list a) : Tac (list a & a) =
match l with
| [] -> raise Splitlast_empty
| [x] -> [], x
| x::xs ->
let init, last = splitlast xs in
x::init, last | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 17,
"end_line": 38,
"start_col": 0,
"start_line": 32
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | l: Prims.list a -> FStar.Tactics.Effect.Tac (Prims.list a * a) | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.list",
"FStar.Tactics.Effect.raise",
"FStar.Pervasives.Native.tuple2",
"Pulse.Recursion.Splitlast_empty",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"Prims.Cons",
"Pulse.Recursion.splitlast"
] | [
"recursion"
] | false | true | false | false | false | let rec splitlast #a (l: list a) : Tac (list a & a) =
| match l with
| [] -> raise Splitlast_empty
| [x] -> [], x
| x :: xs ->
let init, last = splitlast xs in
x :: init, last | false |
Pulse.Recursion.fst | Pulse.Recursion.elab_b | val elab_b (qbv: option qualifier & binder & bv) : Tot Tactics.NamedView.binder | val elab_b (qbv: option qualifier & binder & bv) : Tot Tactics.NamedView.binder | let elab_b (qbv : option qualifier & binder & bv) : Tot Tactics.NamedView.binder =
let q, b, bv = qbv in
{
uniq = bv.bv_index;
ppname = b.binder_ppname.name;
sort = elab_term b.binder_ty;
qual = elab_qual q;
attrs = [];
} | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 3,
"end_line": 80,
"start_col": 0,
"start_line": 72
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false |
qbv:
((FStar.Pervasives.Native.option Pulse.Syntax.Base.qualifier * Pulse.Syntax.Base.binder) *
Pulse.Syntax.Base.bv)
-> FStar.Tactics.NamedView.binder | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.option",
"Pulse.Syntax.Base.qualifier",
"Pulse.Syntax.Base.binder",
"Pulse.Syntax.Base.bv",
"FStar.Tactics.NamedView.Mkbinder",
"Pulse.Syntax.Base.__proj__Mkbv__item__bv_index",
"Pulse.Syntax.Base.__proj__Mkppname__item__name",
"Pulse.Syntax... | [] | false | false | false | true | false | let elab_b (qbv: option qualifier & binder & bv) : Tot Tactics.NamedView.binder =
| let q, b, bv = qbv in
{
uniq = bv.bv_index;
ppname = b.binder_ppname.name;
sort = elab_term b.binder_ty;
qual = elab_qual q;
attrs = []
} | false |
Pulse.Recursion.fst | Pulse.Recursion.tie_knot | val tie_knot (g : env) (rng : R.range)
(nm_orig : string) (nm_aux : string)
(d : decl) (r_typ : R.term) (blob:RT.blob)
: Tac (list (RT.sigelt_for (fstar_env g))) | val tie_knot (g : env) (rng : R.range)
(nm_orig : string) (nm_aux : string)
(d : decl) (r_typ : R.term) (blob:RT.blob)
: Tac (list (RT.sigelt_for (fstar_env g))) | let tie_knot (g : env) (rng : R.range)
(nm_orig nm_aux : string)
(d : decl) (r_typ : R.typ) (blob:RT.blob)
: Tac (list (RT.sigelt_for (fstar_env g)))
=
let knot_r_typ =
(* Remove the last arguments from r_typ, as that is the recursive knot.
After doing that, we now have the needed t... | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 22,
"end_line": 226,
"start_col": 0,
"start_line": 207
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": true,
"full_m... | {
"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_el... | false |
g: Pulse.Typing.Env.env ->
rng: FStar.Range.range ->
nm_orig: Prims.string ->
nm_aux: Prims.string ->
d: Pulse.Syntax.Base.decl ->
r_typ: FStar.Stubs.Reflection.Types.term ->
blob: FStar.Reflection.Typing.blob
-> FStar.Tactics.Effect.Tac
(Prims.list (FStar.Reflection.Typing.sigelt_for... | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Typing.Env.env",
"FStar.Range.range",
"Prims.string",
"Pulse.Syntax.Base.decl",
"FStar.Stubs.Reflection.Types.typ",
"FStar.Reflection.Typing.blob",
"Prims.bool",
"FStar.Stubs.Reflection.Types.sigelt",
"FStar.Pervasives.Native.option",
"Prims.Cons",
"FStar.Reflection.Typing.sigelt_for",
... | [] | false | true | false | false | false | let tie_knot
(g: env)
(rng: R.range)
(nm_orig nm_aux: string)
(d: decl)
(r_typ: R.typ)
(blob: RT.blob)
: Tac (list (RT.sigelt_for (fstar_env g))) =
| let knot_r_typ =
let bs, c = collect_arr_bs r_typ in
if Nil? bs then fail g (Some rng) "tie_knot: impossible (1)";
let bs = init bs in
if Nil? bs then fail g (Some rng) "tie_knot: impossible (2)";
mk_arr bs c
in
let flag, sig, _ = RT.mk_unchecked_let (fstar_env g) nm_orig (`(magic ())) knot_r_typ in
let nm = ... | false |
AlgWP.fst | AlgWP.lift_pure_algwp | val lift_pure_algwp (a: Type) (wp: _) (f: (unit -> PURE a wp))
: Pure (repr a noops (lift_pure_wp wp))
(requires (wp (fun _ -> True)))
(ensures (fun _ -> True)) | val lift_pure_algwp (a: Type) (wp: _) (f: (unit -> PURE a wp))
: Pure (repr a noops (lift_pure_wp wp))
(requires (wp (fun _ -> True)))
(ensures (fun _ -> True)) | let lift_pure_algwp (a:Type) wp (f:unit -> PURE a wp)
: Pure (repr a noops (lift_pure_wp wp)) // can't call f() here, so lift its wp instead
(requires (wp (fun _ -> True)))
(ensures (fun _ -> True))
=
let v : a = FStar.Monotonic.Pure.elim_pure f (fun _ -> True) in
FStar.Monotonic.Pure.elim... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 12,
"end_line": 241,
"start_col": 0,
"start_line": 232
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | a: Type -> wp: Prims.pure_wp a -> f: (_: Prims.unit -> Prims.PURE a)
-> Prims.Pure (AlgWP.repr a AlgWP.noops (AlgWP.lift_pure_wp wp)) | Prims.Pure | [] | [] | [
"Prims.pure_wp",
"Prims.unit",
"Alg.Return",
"FStar.Pervasives.assert_norm",
"AlgWP.stronger",
"AlgWP.lift_pure_wp",
"AlgWP.return_wp",
"Prims._assert",
"Prims.l_Forall",
"Prims.l_imp",
"FStar.Monotonic.Pure.elim_pure_wp_monotonicity",
"FStar.Monotonic.Pure.elim_pure",
"Prims.l_True",
"Alg... | [] | false | false | false | false | false | let lift_pure_algwp (a: Type) wp (f: (unit -> PURE a wp))
: Pure (repr a noops (lift_pure_wp wp))
(requires (wp (fun _ -> True)))
(ensures (fun _ -> True)) =
| let v:a = FStar.Monotonic.Pure.elim_pure f (fun _ -> True) in
FStar.Monotonic.Pure.elim_pure_wp_monotonicity wp;
assert (forall p. wp p ==> p v);
assert_norm (stronger (lift_pure_wp wp) (return_wp v));
Return v | false |
Pulse.Recursion.fst | Pulse.Recursion.freshen_binder | val freshen_binder (b: T.binder) : T.binder | val freshen_binder (b: T.binder) : T.binder | let freshen_binder (b:T.binder) : T.binder =
{ b with uniq = 10000 + b.uniq
; ppname = map_seal b.ppname (fun s -> s ^ "'") } | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 58,
"end_line": 58,
"start_col": 0,
"start_line": 56
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module"... | {
"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_el... | false | b: FStar.Tactics.NamedView.binder -> FStar.Tactics.NamedView.binder | Prims.Tot | [
"total"
] | [] | [
"FStar.Tactics.NamedView.binder",
"FStar.Tactics.NamedView.Mkbinder",
"Prims.op_Addition",
"FStar.Tactics.NamedView.__proj__Mkbinder__item__uniq",
"FStar.Sealed.map_seal",
"Prims.string",
"FStar.Tactics.NamedView.__proj__Mkbinder__item__ppname",
"Prims.op_Hat",
"FStar.Tactics.NamedView.__proj__Mkbin... | [] | false | false | false | true | false | let freshen_binder (b: T.binder) : T.binder =
| { b with uniq = 10000 + b.uniq; ppname = map_seal b.ppname (fun s -> s ^ "'") } | false |
AlgWP.fst | AlgWP.quotient_ro | val quotient_ro (#a: _) (w: st_wp a) : st_wp a | val quotient_ro (#a: _) (w: st_wp a) : st_wp a | let quotient_ro #a (w : st_wp a) : st_wp a =
fun s0 p -> w s0 (fun (y, s1) -> s0 == s1 ==> p (y, s1)) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 58,
"end_line": 272,
"start_col": 0,
"start_line": 271
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | w: AlgWP.st_wp a -> AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.logical",
"Prims.l_imp",
"Prims.eq2",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | true | false | let quotient_ro #a (w: st_wp a) : st_wp a =
| fun s0 p -> w s0 (fun (y, s1) -> s0 == s1 ==> p (y, s1)) | false |
AlgWP.fst | AlgWP.put | val put (s: state) : AlgWP unit [Write] (write_wp s) | val put (s: state) : AlgWP unit [Write] (write_wp s) | let put (s:state) : AlgWP unit [Write] (write_wp s) =
AlgWP?.reflect (Op Write s Return) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 225,
"start_col": 0,
"start_line": 224
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | s: Alg.state -> AlgWP.AlgWP Prims.unit | AlgWP.AlgWP | [] | [] | [
"Alg.state",
"Alg.Op",
"Prims.unit",
"Alg.Write",
"Alg.Return",
"Prims.Cons",
"Alg.op",
"Prims.Nil",
"AlgWP.write_wp"
] | [] | false | true | false | false | false | let put (s: state) : AlgWP unit [Write] (write_wp s) =
| AlgWP?.reflect (Op Write s Return) | false |
AlgWP.fst | AlgWP.addx | val addx (x: int) : AlgWP unit [Read; Write] (fun s0 p -> p ((), (s0 + x))) | val addx (x: int) : AlgWP unit [Read; Write] (fun s0 p -> p ((), (s0 + x))) | let addx (x:int) : AlgWP unit [Read; Write] (fun s0 p -> p ((), (s0+x))) =
let y = get () in
put (x+y) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 11,
"end_line": 247,
"start_col": 0,
"start_line": 245
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | x: Prims.int -> AlgWP.AlgWP Prims.unit | AlgWP.AlgWP | [] | [] | [
"Prims.int",
"AlgWP.put",
"Prims.op_Addition",
"Prims.unit",
"Alg.state",
"AlgWP.get",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | true | false | false | false | let addx (x: int) : AlgWP unit [Read; Write] (fun s0 p -> p ((), (s0 + x))) =
| let y = get () in
put (x + y) | false |
Pulse.Checker.Prover.ElimExists.fst | Pulse.Checker.Prover.ElimExists.mk | val mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop)
: T.Tac
(option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c)
) | val mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop)
: T.Tac
(option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c)
) | let mk (#g:env) (#v:vprop) (v_typing:tot_typing g v tm_vprop)
: T.Tac (option (x:ppname &
t:st_term &
c:comp { stateful_comp c /\ comp_pre c == v } &
st_typing g t c)) =
match v.t with
| Tm_ExistsSL u { binder_ppname=nm; binder_ty = t } p ->
let x = fr... | {
"file_name": "lib/steel/pulse/Pulse.Checker.Prover.ElimExists.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 13,
"end_line": 49,
"start_col": 0,
"start_line": 35
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.Checker.VPropEquiv.fsti.checked",
"Pulse.Checker.Prover.Base.fsti.checked",
"prims.fst.checked",
"FStar.... | [
{
"abbrev": false,
"full_module": "Pulse.Checker.Prover.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker.VPropEquiv",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": ... | {
"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_el... | false | v_typing: Pulse.Typing.tot_typing g v Pulse.Syntax.Base.tm_vprop
-> FStar.Tactics.Effect.Tac
(FStar.Pervasives.Native.option (FStar.Pervasives.dtuple4 Pulse.Syntax.Base.ppname
(fun _ -> Pulse.Syntax.Base.st_term)
(fun _ _ ->
c:
Pulse.Syntax.Base.comp
... | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Typing.Env.env",
"Pulse.Syntax.Base.vprop",
"Pulse.Typing.tot_typing",
"Pulse.Syntax.Base.tm_vprop",
"Pulse.Syntax.Base.__proj__Mkterm__item__t",
"Pulse.Syntax.Base.universe",
"Pulse.Syntax.Base.term",
"Pulse.Syntax.Base.ppname",
"FStar.Sealed.Inhabited.sealed",
"Prims.list",
"Prims.Nil",... | [] | false | true | false | false | false | let mk (#g: env) (#v: vprop) (v_typing: tot_typing g v tm_vprop)
: T.Tac
(option (x: ppname & t: st_term & c: comp{stateful_comp c /\ comp_pre c == v} & st_typing g t c)
) =
| match v.t with
| Tm_ExistsSL u { binder_ppname = nm ; binder_ty = t } p ->
let x = fresh g in
let c = Pulse.Typing.comp_elim_exists u t p (nm, x) in
let tm_typing:st_typing g _ c = T_ElimExists g (comp_u c) t p x (RU.magic ()) (RU.magic ()) in
Some (| nm, _, c, tm_typing |)
| _ -> None | false |
AlgWP.fst | AlgWP.null_ro | val null_ro (#a: _) : st_wp a | val null_ro (#a: _) : st_wp a | let null_ro #a : st_wp a = quotient_ro null | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 43,
"end_line": 358,
"start_col": 0,
"start_line": 358
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"AlgWP.quotient_ro",
"AlgWP.null",
"AlgWP.st_wp"
] | [] | false | false | false | true | false | let null_ro #a : st_wp a =
| quotient_ro null | false |
AlgWP.fst | AlgWP.st_soundness_aux | val st_soundness_aux (#a #wp: _) (t: repr a [Read; Write] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) | val st_soundness_aux (#a #wp: _) (t: repr a [Read; Write] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) | let st_soundness_aux #a #wp (t : repr a [Read; Write] wp)
: Tot (s0:state -> ID5.ID (a & state) (as_pure_wp (wp s0)))
= interp_sem t | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 16,
"end_line": 293,
"start_col": 0,
"start_line": 291
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: AlgWP.repr a [Alg.Read; Alg.Write] wp -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.st_wp",
"AlgWP.repr",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.interp_sem",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"FStar.Monotonic.Pure.as_pure_wp"
] | [] | false | true | false | false | false | let st_soundness_aux #a #wp (t: repr a [Read; Write] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) =
| interp_sem t | false |
AlgWP.fst | AlgWP.sanity_1 | val sanity_1 : Prims.unit | let sanity_1 = assert (forall s0 p. quotient_ro read_wp s0 p <==> read_wp s0 p) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 79,
"end_line": 279,
"start_col": 0,
"start_line": 279
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | Prims.unit | Prims.Tot | [
"total"
] | [] | [
"Prims._assert",
"Prims.l_Forall",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.l_iff",
"AlgWP.quotient_ro",
"AlgWP.read_wp"
] | [] | false | false | false | true | false | let sanity_1 =
| assert (forall s0 p. quotient_ro read_wp s0 p <==> read_wp s0 p) | false | |
AlgWP.fst | AlgWP.add_via_state | val add_via_state (x y: int) : AlgWP int [Read; Write] (fun s0 p -> p ((x + y), s0)) | val add_via_state (x y: int) : AlgWP int [Read; Write] (fun s0 p -> p ((x + y), s0)) | let add_via_state (x y : int) : AlgWP int [Read;Write] (fun s0 p -> p ((x+y), s0)) =
let o = get () in
put x;
addx y;
let r = get () in
put o;
r | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 3,
"end_line": 258,
"start_col": 0,
"start_line": 252
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.WellFounded",
... | {
"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_el... | false | x: Prims.int -> y: Prims.int -> AlgWP.AlgWP Prims.int | AlgWP.AlgWP | [] | [] | [
"Prims.int",
"Prims.unit",
"AlgWP.put",
"Alg.state",
"AlgWP.get",
"AlgWP.addx",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.Mktuple2",
"Prims.op_Addition"
] | [] | false | true | false | false | false | let add_via_state (x y: int) : AlgWP int [Read; Write] (fun s0 p -> p ((x + y), s0)) =
| let o = get () in
put x;
addx y;
let r = get () in
put o;
r | false |
AlgWP.fst | AlgWP.sanity_2 | val sanity_2 : Prims.unit | let sanity_2 = assert (forall s0 p s1. p ((), s0) ==> quotient_ro (write_wp s1) s0 p) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 85,
"end_line": 280,
"start_col": 0,
"start_line": 280
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | Prims.unit | Prims.Tot | [
"total"
] | [] | [
"Prims._assert",
"Prims.l_Forall",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.unit",
"Prims.l_imp",
"FStar.Pervasives.Native.Mktuple2",
"AlgWP.quotient_ro",
"AlgWP.write_wp"
] | [] | false | false | false | true | false | let sanity_2 =
| assert (forall s0 p s1. p ((), s0) ==> quotient_ro (write_wp s1) s0 p) | false | |
AlgWP.fst | AlgWP.st_soundness | val st_soundness (#a #wp: _) (t: (unit -> AlgWP a [Read; Write] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) | val st_soundness (#a #wp: _) (t: (unit -> AlgWP a [Read; Write] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) | let st_soundness #a #wp (t : unit -> AlgWP a [Read; Write] wp)
: Tot (s0:state -> ID5.ID (a & state) (as_pure_wp (wp s0)))
= st_soundness_aux (reify (t ())) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 35,
"end_line": 297,
"start_col": 0,
"start_line": 295
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: (_: Prims.unit -> AlgWP.AlgWP a) -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.st_wp",
"Prims.unit",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"AlgWP.st_soundness_aux",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"FStar.Monotonic.Pure.as_pure_wp"
] | [] | false | true | false | false | false | let st_soundness #a #wp (t: (unit -> AlgWP a [Read; Write] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (wp s0))) =
| st_soundness_aux (reify (t ())) | false |
AlgWP.fst | AlgWP.interp_sem | val interp_sem (#a: _) (t: rwtree a [Read; Write]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (interp_as_wp t s0)) | val interp_sem (#a: _) (t: rwtree a [Read; Write]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (interp_as_wp t s0)) | let rec interp_sem #a (t : rwtree a [Read; Write]) (s0:state)
: ID5.ID (a & state) (as_pure_wp (interp_as_wp t s0))
= match t with
| Return x -> (x, s0)
| Op Read i k ->
interp_sem (k s0) s0
| Op Write i k ->
interp_sem (k ()) i | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 269,
"start_col": 0,
"start_line": 262
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: AlgWP.rwtree a [Alg.Read; Alg.Write] -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.rwtree",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Alg.Write",
"Prims.Nil",
"Alg.state",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.tuple2",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.interp_sem",
"FStar.Monotonic.Pure.as_pure_wp",
"AlgWP.interp_as_wp"
] | [
"recursion"
] | false | true | false | false | false | let rec interp_sem #a (t: rwtree a [Read; Write]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (interp_as_wp t s0)) =
| match t with
| Return x -> (x, s0)
| Op Read i k -> interp_sem (k s0) s0
| Op Write i k -> interp_sem (k ()) i | false |
AlgWP.fst | AlgWP.ro_soundness | val ro_soundness (#a #wp: _) ($t: (unit -> AlgWP a [Read] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) | val ro_soundness (#a #wp: _) ($t: (unit -> AlgWP a [Read] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) | let ro_soundness #a #wp ($t : unit -> AlgWP a [Read] wp)
: Tot (s0:state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0)))
= ro_soundness_aux (reify (t ())) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 35,
"end_line": 308,
"start_col": 0,
"start_line": 306
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | $t: (_: Prims.unit -> AlgWP.AlgWP a) -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.st_wp",
"Prims.unit",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"AlgWP.ro_soundness_aux",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"FStar.Monotonic.Pure.as_pure_wp",
"AlgWP.quotient_ro"
] | [] | false | true | false | false | false | let ro_soundness #a #wp ($t: (unit -> AlgWP a [Read] wp))
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) =
| ro_soundness_aux (reify (t ())) | false |
AlgWP.fst | AlgWP.ro_soundness_aux | val ro_soundness_aux (#a #wp: _) ($t: repr a [Read] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) | val ro_soundness_aux (#a #wp: _) ($t: repr a [Read] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) | let ro_soundness_aux #a #wp ($t : repr a [Read] wp)
: Tot (s0:state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0)))
= interp_ro t | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 15,
"end_line": 304,
"start_col": 0,
"start_line": 302
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | $t: AlgWP.repr a [Alg.Read] wp -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.st_wp",
"AlgWP.repr",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"AlgWP.interp_ro",
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"FStar.Monotonic.Pure.as_pure_wp",
"AlgWP.quotient_ro"
] | [] | false | true | false | false | false | let ro_soundness_aux #a #wp ($t: repr a [Read] wp)
: Tot (s0: state -> ID5.ID (a & state) (as_pure_wp (quotient_ro wp s0))) =
| interp_ro t | false |
AlgWP.fst | AlgWP.interp_ro | val interp_ro (#a: _) (t: rwtree a [Read]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (quotient_ro (interp_as_wp t) s0)) | val interp_ro (#a: _) (t: rwtree a [Read]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (quotient_ro (interp_as_wp t) s0)) | let rec interp_ro #a (t : rwtree a [Read]) (s0:state)
: ID5.ID (a & state) (as_pure_wp (quotient_ro (interp_as_wp t) s0))
= match t with
| Return x -> (x, s0)
| Op Read i k ->
interp_ro (k s0) s0 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 288,
"start_col": 0,
"start_line": 283
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: AlgWP.rwtree a [Alg.Read] -> s0: Alg.state -> ID5.ID (a * Alg.state) | ID5.ID | [] | [] | [
"AlgWP.rwtree",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"Alg.state",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.tuple2",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.interp_ro",
"FStar.Monotonic.Pure.as_pure_wp",
"AlgWP.quotient_ro",
"AlgWP.interp_as_wp"
] | [
"recursion"
] | false | true | false | false | false | let rec interp_ro #a (t: rwtree a [Read]) (s0: state)
: ID5.ID (a & state) (as_pure_wp (quotient_ro (interp_as_wp t) s0)) =
| match t with
| Return x -> (x, s0)
| Op Read i k -> interp_ro (k s0) s0 | false |
AlgWP.fst | AlgWP.ro_soundness_pre_post | val ro_soundness_pre_post (#a #wp: _) (t: (unit -> AlgWP a [Read] wp)) (s0: state)
: ID5.Id (a & state) (requires (wp s0 (fun _ -> True))) (ensures (fun (r, s1) -> s0 == s1)) | val ro_soundness_pre_post (#a #wp: _) (t: (unit -> AlgWP a [Read] wp)) (s0: state)
: ID5.Id (a & state) (requires (wp s0 (fun _ -> True))) (ensures (fun (r, s1) -> s0 == s1)) | let ro_soundness_pre_post #a #wp (t : unit -> AlgWP a [Read] wp)
(s0:state)
: ID5.Id (a & state) (requires (wp s0 (fun _ -> True)))
(ensures (fun (r, s1) -> s0 == s1))
= ro_soundness t s0 | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 21,
"end_line": 318,
"start_col": 0,
"start_line": 314
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: (_: Prims.unit -> AlgWP.AlgWP a) -> s0: Alg.state -> ID5.Id (a * Alg.state) | ID5.Id | [] | [] | [
"AlgWP.st_wp",
"Prims.unit",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"Alg.state",
"AlgWP.ro_soundness",
"FStar.Pervasives.Native.tuple2",
"Prims.l_True",
"Prims.eq2"
] | [] | false | true | false | false | false | let ro_soundness_pre_post #a #wp (t: (unit -> AlgWP a [Read] wp)) (s0: state)
: ID5.Id (a & state) (requires (wp s0 (fun _ -> True))) (ensures (fun (r, s1) -> s0 == s1)) =
| ro_soundness t s0 | false |
AlgWP.fst | AlgWP.null_ro1 | val null_ro1 (#a: _) : st_wp a | val null_ro1 (#a: _) : st_wp a | let null_ro1 #a : st_wp a = fun s0 p -> forall x. p (x, s0) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 59,
"end_line": 359,
"start_col": 0,
"start_line": 359
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.l_Forall",
"FStar.Pervasives.Native.Mktuple2",
"Prims.logical",
"AlgWP.st_wp"
] | [] | false | false | false | true | false | let null_ro1 #a : st_wp a =
| fun s0 p -> forall x. p (x, s0) | false |
Pulse.Recursion.fst | Pulse.Recursion.add_knot | val add_knot (g : env) (rng : R.range)
(d : decl)
: Tac decl | val add_knot (g : env) (rng : R.range)
(d : decl)
: Tac decl | let add_knot (g : env) (rng : R.range)
(d : decl{FnDecl? d.d})
: Tac decl
=
let FnDecl { id; isrec; bs; comp; meas; body } = d.d in
if Nil? bs then
fail g (Some d.range) "main: FnDecl does not have binders";
(* NB: bs and comp are open *)
let r_res = elab_comp comp in
debug_main g
(fun _ ... | {
"file_name": "lib/steel/pulse/Pulse.Recursion.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 3,
"end_line": 205,
"start_col": 0,
"start_line": 82
} | (*
Copyright 2023 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... | {
"checked_file": "/",
"dependencies": [
"Pulse.Typing.fst.checked",
"Pulse.Syntax.Printer.fsti.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"Pulse.PP.fst.checked",
"prims.fst.checked",
"FStar.Tactics.V2.SyntaxHelpers.fst.checked",
"FStar.Tactics.V2.fst.ch... | [
{
"abbrev": true,
"full_module": "Pulse.Syntax.Printer",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": true,
"full_m... | {
"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_el... | false | g: Pulse.Typing.Env.env -> rng: FStar.Range.range -> d: Pulse.Syntax.Base.decl
-> FStar.Tactics.Effect.Tac Pulse.Syntax.Base.decl | FStar.Tactics.Effect.Tac | [] | [] | [
"Pulse.Typing.Env.env",
"FStar.Range.range",
"Pulse.Syntax.Base.decl",
"Prims.b2t",
"Pulse.Syntax.Base.uu___is_FnDecl",
"Pulse.Syntax.Base.__proj__Mkdecl__item__d",
"FStar.Stubs.Reflection.Types.ident",
"Prims.bool",
"Prims.list",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.option... | [] | false | true | false | false | false | let add_knot (g: env) (rng: R.range) (d: decl{FnDecl? d.d}) : Tac decl =
| let FnDecl { id = id ; isrec = isrec ; bs = bs ; comp = comp ; meas = meas ; body = body } = d.d in
if Nil? bs then fail g (Some d.range) "main: FnDecl does not have binders";
let r_res = elab_comp comp in
debug_main g
(fun _ ->
Printf.sprintf "add_knot: bs = %s\n"
(string_of_list (fun (_, b, _) -> P.bi... | false |
AlgWP.fst | AlgWP.null_equiv_sanity | val null_equiv_sanity : a: Type -> Prims.unit | let null_equiv_sanity a = assert (null_ro #a `equiv` null_ro1 #a) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 65,
"end_line": 360,
"start_col": 0,
"start_line": 360
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | a: Type -> Prims.unit | Prims.Tot | [
"total"
] | [] | [
"Prims._assert",
"AlgWP.equiv",
"AlgWP.null_ro",
"AlgWP.null_ro1",
"Prims.unit"
] | [] | false | false | false | true | false | let null_equiv_sanity a =
| assert ((null_ro #a) `equiv` (null_ro1 #a)) | false | |
AlgWP.fst | AlgWP.quot_tree | val quot_tree (#a #wp: _) (c: repr a [Read] wp) : repr a [Read] (quotient_ro wp) | val quot_tree (#a #wp: _) (c: repr a [Read] wp) : repr a [Read] (quotient_ro wp) | let quot_tree #a #wp (c : repr a [Read] wp)
: repr a [Read] (quotient_ro wp)
= ro_tree_wp c;
c | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 344,
"start_col": 0,
"start_line": 341
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | c: AlgWP.repr a [Alg.Read] wp -> AlgWP.repr a [Alg.Read] (AlgWP.quotient_ro wp) | Prims.Tot | [
"total"
] | [] | [
"AlgWP.st_wp",
"AlgWP.repr",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"Prims.unit",
"AlgWP.ro_tree_wp",
"AlgWP.quotient_ro"
] | [] | false | false | false | false | false | let quot_tree #a #wp (c: repr a [Read] wp) : repr a [Read] (quotient_ro wp) =
| ro_tree_wp c;
c | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_abc_is_acb | val lemma_abc_is_acb (a b c:nat) : Lemma (a * b * c = a * c * b) | val lemma_abc_is_acb (a b c:nat) : Lemma (a * b * c = a * c * b) | let lemma_abc_is_acb a b c =
Math.Lemmas.paren_mul_right a b c;
Math.Lemmas.swap_mul b c;
Math.Lemmas.paren_mul_right a c b | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 21,
"start_col": 0,
"start_line": 18
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Prims.nat -> b: Prims.nat -> c: Prims.nat
-> FStar.Pervasives.Lemma (ensures (a * b) * c = (a * c) * b) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Math.Lemmas.paren_mul_right",
"Prims.unit",
"FStar.Math.Lemmas.swap_mul"
] | [] | true | false | true | false | false | let lemma_abc_is_acb a b c =
| Math.Lemmas.paren_mul_right a b c;
Math.Lemmas.swap_mul b c;
Math.Lemmas.paren_mul_right a c b | false |
AlgWP.fst | AlgWP.ro_tree_wp | val ro_tree_wp (#a: _) (t: tree a [Read]) : Lemma (is_ro (interp_as_wp t)) | val ro_tree_wp (#a: _) (t: tree a [Read]) : Lemma (is_ro (interp_as_wp t)) | let rec ro_tree_wp #a (t : tree a [Read])
: Lemma (is_ro (interp_as_wp t))
= match t with
| Return x -> ()
| Op Read i k ->
let aux (x:state) : Lemma (is_ro (interp_as_wp (k x))) =
ro_tree_wp (k x)
in
Classical.forall_intro aux;
bind_ro read_wp (fun x -> interp_as_wp (k x)) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 51,
"end_line": 339,
"start_col": 0,
"start_line": 330
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: Alg.tree a [Alg.Read] -> FStar.Pervasives.Lemma (ensures AlgWP.is_ro (AlgWP.interp_as_wp t)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Alg.tree",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.bind_ro",
"Alg.state",
"AlgWP.read_wp",
"AlgWP.interp_as_wp",
"AlgWP.st_wp",
"Prims.unit",
"FStar.Classical.forall_intro",
"AlgWP.is_ro",
"Prims.l_True",
"Prims.squash",
"... | [
"recursion"
] | false | false | true | false | false | let rec ro_tree_wp #a (t: tree a [Read]) : Lemma (is_ro (interp_as_wp t)) =
| match t with
| Return x -> ()
| Op Read i k ->
let aux (x: state) : Lemma (is_ro (interp_as_wp (k x))) = ro_tree_wp (k x) in
Classical.forall_intro aux;
bind_ro read_wp (fun x -> interp_as_wp (k x)) | false |
AlgWP.fst | AlgWP.quot | val quot (#a #wp: _) (f: (unit -> AlgWP a [Read] wp)) : AlgWP a [Read] (quotient_ro wp) | val quot (#a #wp: _) (f: (unit -> AlgWP a [Read] wp)) : AlgWP a [Read] (quotient_ro wp) | let quot #a #wp (f : unit -> AlgWP a [Read] wp)
: AlgWP a [Read] (quotient_ro wp)
= AlgWP?.reflect (quot_tree (reify (f ()))) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 45,
"end_line": 348,
"start_col": 0,
"start_line": 346
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | f: (_: Prims.unit -> AlgWP.AlgWP a) -> AlgWP.AlgWP a | AlgWP.AlgWP | [] | [] | [
"AlgWP.st_wp",
"Prims.unit",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"AlgWP.quot_tree",
"AlgWP.quotient_ro"
] | [] | false | true | false | false | false | let quot #a #wp (f: (unit -> AlgWP a [Read] wp)) : AlgWP a [Read] (quotient_ro wp) =
| AlgWP?.reflect (quot_tree (reify (f ()))) | false |
AlgWP.fst | AlgWP.ignore_writes | val ignore_writes
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#pre #post: _)
(f: (unit -> AlgPP a (Write :: l) pre post))
: AlgPP a l pre (fun h0 x h1 -> h0 == h1) | val ignore_writes
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#pre #post: _)
(f: (unit -> AlgPP a (Write :: l) pre post))
: AlgPP a l pre (fun h0 x h1 -> h0 == h1) | let ignore_writes #a (#l:rwops{~(List.Tot.memP Write l)}) #pre #post (f : unit -> AlgPP a (Write::l) pre post)
: AlgPP a l pre (fun h0 x h1 -> h0 == h1)
= handle_into_ro #a #l #(fun h0 p -> pre h0 /\ (forall y h1. post h0 y h1 ==> p (y, h1))) f | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 93,
"end_line": 404,
"start_col": 0,
"start_line": 402
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | f: (_: Prims.unit -> AlgWP.AlgPP a) -> AlgWP.AlgPP a | AlgWP.AlgPP | [] | [] | [
"AlgWP.rwops",
"Prims.l_not",
"FStar.List.Tot.Base.memP",
"Alg.op",
"Alg.Write",
"Alg.state",
"Prims.unit",
"Prims.Cons",
"AlgWP.handle_into_ro",
"FStar.Pervasives.Native.tuple2",
"Prims.logical",
"Prims.l_and",
"Prims.l_Forall",
"Prims.l_imp",
"FStar.Pervasives.Native.Mktuple2",
"Prim... | [] | false | true | false | false | false | let ignore_writes
#a
(#l: rwops{~(List.Tot.memP Write l)})
#pre
#post
(f: (unit -> AlgPP a (Write :: l) pre post))
: AlgPP a l pre (fun h0 x h1 -> h0 == h1) =
| handle_into_ro #a #l #(fun h0 p -> pre h0 /\ (forall y h1. post h0 y h1 ==> p (y, h1))) f | false |
AlgWP.fst | AlgWP.null | val null (#a: _) : st_wp a | val null (#a: _) : st_wp a | let null #a : st_wp a = fun s0 p -> forall r. p r | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 49,
"end_line": 357,
"start_col": 0,
"start_line": 357
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | AlgWP.st_wp a | Prims.Tot | [
"total"
] | [] | [
"Alg.state",
"FStar.Pervasives.Native.tuple2",
"Prims.l_Forall",
"Prims.logical",
"AlgWP.st_wp"
] | [] | false | false | false | true | false | let null #a : st_wp a =
| fun s0 p -> forall r. p r | false |
AlgWP.fst | AlgWP.handle_into_ro | val handle_into_ro
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#wp: _)
(f: (unit -> AlgWP a (Write :: l) wp))
: AlgWP a l null_ro | val handle_into_ro
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#wp: _)
(f: (unit -> AlgWP a (Write :: l) wp))
: AlgWP a l null_ro | let handle_into_ro #a (#l:rwops{~(List.Tot.memP Write l)}) #wp (f : unit -> AlgWP a (Write::l) wp)
: AlgWP a l null_ro
= AlgWP?.reflect (__tree_handle_into_ro (reify (f ()))) | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 57,
"end_line": 400,
"start_col": 0,
"start_line": 398
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | f: (_: Prims.unit -> AlgWP.AlgWP a) -> AlgWP.AlgWP a | AlgWP.AlgWP | [] | [] | [
"AlgWP.rwops",
"Prims.l_not",
"FStar.List.Tot.Base.memP",
"Alg.op",
"Alg.Write",
"AlgWP.st_wp",
"Prims.unit",
"Prims.Cons",
"AlgWP.__tree_handle_into_ro",
"AlgWP.null_ro"
] | [] | false | true | false | false | false | let handle_into_ro
#a
(#l: rwops{~(List.Tot.memP Write l)})
#wp
(f: (unit -> AlgWP a (Write :: l) wp))
: AlgWP a l null_ro =
| AlgWP?.reflect (__tree_handle_into_ro (reify (f ()))) | false |
FStar.Matrix.fst | FStar.Matrix.matrix_left_mul_identity_aux_2 | val matrix_left_mul_identity_aux_2
(#c #eq #m: _)
(add: CE.cm c eq)
(mul: CE.cm c eq {is_absorber add.unit mul})
(mx: matrix c m m)
(i j: under m)
(k: nat{k = i + 1})
: Lemma
(ensures
(SP.foldm_snoc add
(SB.init k
(fun (k: under m) -> (ijth (matr... | val matrix_left_mul_identity_aux_2
(#c #eq #m: _)
(add: CE.cm c eq)
(mul: CE.cm c eq {is_absorber add.unit mul})
(mx: matrix c m m)
(i j: under m)
(k: nat{k = i + 1})
: Lemma
(ensures
(SP.foldm_snoc add
(SB.init k
(fun (k: under m) -> (ijth (matr... | let matrix_left_mul_identity_aux_2 #c #eq #m
(add: CE.cm c eq)
(mul: CE.cm c eq{is_absorber add.unit mul})
(mx: matrix c m m)
(i j: under m) (k:nat{k=i+1})
:... | {
"file_name": "ulib/FStar.Matrix.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 61,
"end_line": 980,
"start_col": 0,
"start_line": 950
} | (*
Copyright 2022 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... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Seq.Properties.fsti.checked",
"FStar.Seq.Permutation.fsti.checked",
"FStar.Seq.Equiv.fsti.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.f... | [
{
"abbrev": false,
"full_module": "FStar.Seq.Equiv",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.IntegerIntervals",
"short_module": null
},
{
"abbrev": true,
"full_modu... | {
"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_el... | false |
add: FStar.Algebra.CommMonoid.Equiv.cm c eq ->
mul: FStar.Algebra.CommMonoid.Equiv.cm c eq {FStar.Matrix.is_absorber (CM?.unit add) mul} ->
mx: FStar.Matrix.matrix c m m ->
i: FStar.IntegerIntervals.under m ->
j: FStar.IntegerIntervals.under m ->
k: Prims.nat{k = i + 1}
-> FStar.Pervasives.Le... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.Algebra.CommMonoid.Equiv.equiv",
"Prims.pos",
"FStar.Algebra.CommMonoid.Equiv.cm",
"FStar.Matrix.is_absorber",
"FStar.Algebra.CommMonoid.Equiv.__proj__CM__item__unit",
"FStar.Matrix.matrix",
"FStar.IntegerIntervals.under",
"Prims.nat",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Pri... | [] | false | false | true | false | false | let matrix_left_mul_identity_aux_2
#c
#eq
#m
(add: CE.cm c eq)
(mul: CE.cm c eq {is_absorber add.unit mul})
(mx: matrix c m m)
(i: under m)
(j: under m)
(k: nat{k = i + 1})
: Lemma
(ensures
(SP.foldm_snoc add
(SB.init k
(fun (k:... | let unit = matrix_mul_unit add mul m in
let mxu = matrix_mul add mul mx unit in
let ( * ) = mul.mult in
let ( $=$ ) = eq.eq in
let gen (k: under m) = ijth unit i k * ijth mx k j in
let full = SB.init k gen in
let liat, last = SProp.un_snoc full in
assert (k - 1 <= i /\ k - 1 >= 0);
if (k - 1) = 0
then matrix_left_mul_i... | false |
AlgWP.fst | AlgWP.__tree_handle_into_ro | val __tree_handle_into_ro
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#wp: _)
(f: repr a (Write :: l) wp)
: repr a l null_ro | val __tree_handle_into_ro
(#a: _)
(#l: rwops{~(List.Tot.memP Write l)})
(#wp: _)
(f: repr a (Write :: l) wp)
: repr a l null_ro | let __tree_handle_into_ro #a (#l:rwops{~(List.Tot.memP Write l)}) #wp (f : repr a (Write::l) wp)
: repr a l null_ro
= let f' : tree a (Write::l) = f in
let h : tree a l =
handle_tree f' (fun x -> Return x)
(function Write -> fun i k -> k ()
| op -> fun i k... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 5,
"end_line": 395,
"start_col": 0,
"start_line": 384
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | f: AlgWP.repr a (Alg.Write :: l) wp -> AlgWP.repr a l AlgWP.null_ro | Prims.Tot | [
"total"
] | [] | [
"AlgWP.rwops",
"Prims.l_not",
"FStar.List.Tot.Base.memP",
"Alg.op",
"Alg.Write",
"AlgWP.st_wp",
"AlgWP.repr",
"Prims.Cons",
"Prims.unit",
"AlgWP.null_ro_tree_wp",
"Alg.tree",
"Alg.Read",
"Prims.Nil",
"Prims._assert",
"Alg.sublist",
"Alg.handle_tree",
"Alg.Return",
"Alg.op_inp",
"... | [] | false | false | false | false | false | let __tree_handle_into_ro #a (#l: rwops{~(List.Tot.memP Write l)}) #wp (f: repr a (Write :: l) wp)
: repr a l null_ro =
| let f':tree a (Write :: l) = f in
let h:tree a l =
handle_tree f'
(fun x -> Return x)
(function
| Write -> fun i k -> k ()
| op -> fun i k -> Op op i k)
in
assert (sublist l [Read]);
let h:tree a [Read] = h in
null_ro_tree_wp h;
h | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_from_to_mont_id_gen | val lemma_from_to_mont_id_gen (n mont_R mont_R_inv:pos) (a:nat{a < n}) : Lemma
(requires mont_R_inv * mont_R % n = 1)
(ensures (a * mont_R_inv % n) * mont_R % n == a) | val lemma_from_to_mont_id_gen (n mont_R mont_R_inv:pos) (a:nat{a < n}) : Lemma
(requires mont_R_inv * mont_R % n = 1)
(ensures (a * mont_R_inv % n) * mont_R % n == a) | let lemma_from_to_mont_id_gen n mont_R mont_R_inv a =
lemma_to_from_mont_id_gen n mont_R_inv mont_R a | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 49,
"end_line": 51,
"start_col": 0,
"start_line": 50
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R: Prims.pos -> mont_R_inv: Prims.pos -> a: Prims.nat{a < n}
-> FStar.Pervasives.Lemma (requires mont_R_inv * mont_R % n = 1)
(ensures (a * mont_R_inv % n) * mont_R % n == a) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Hacl.Spec.P256.Montgomery.lemma_to_from_mont_id_gen",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_from_to_mont_id_gen n mont_R mont_R_inv a =
| lemma_to_from_mont_id_gen n mont_R_inv mont_R a | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_mod_mul_assoc | val lemma_mod_mul_assoc (n:pos) (a b c:nat) : Lemma ((a * b % n) * c % n == (a * (b * c % n)) % n) | val lemma_mod_mul_assoc (n:pos) (a b c:nat) : Lemma ((a * b % n) * c % n == (a * (b * c % n)) % n) | let lemma_mod_mul_assoc m a b c =
calc (==) {
(a * b % m) * c % m;
(==) { Math.Lemmas.lemma_mod_mul_distr_l (a * b) c m }
(a * b) * c % m;
(==) { Math.Lemmas.paren_mul_right a b c }
a * (b * c) % m;
(==) { Math.Lemmas.lemma_mod_mul_distr_r a (b * c) m }
a * (b * c % m) % m;
} | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 34,
"start_col": 0,
"start_line": 25
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> a: Prims.nat -> b: Prims.nat -> c: Prims.nat
-> FStar.Pervasives.Lemma (ensures (a * b % n) * c % n == a * (b * c % n) % n) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.lemma_mod_... | [] | false | false | true | false | false | let lemma_mod_mul_assoc m a b c =
| calc ( == ) {
(a * b % m) * c % m;
( == ) { Math.Lemmas.lemma_mod_mul_distr_l (a * b) c m }
(a * b) * c % m;
( == ) { Math.Lemmas.paren_mul_right a b c }
a * (b * c) % m;
( == ) { Math.Lemmas.lemma_mod_mul_distr_r a (b * c) m }
a * (b * c % m) % m;
} | false |
MerkleTree.New.High.fst | MerkleTree.New.High.sha256_compress | val sha256_compress: src1:hash #32 -> src2:hash #32 -> GTot (hash #32) | val sha256_compress: src1:hash #32 -> src2:hash #32 -> GTot (hash #32) | let sha256_compress = MTS.sha256_compress | {
"file_name": "src/MerkleTree.New.High.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 41,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | module MerkleTree.New.High
open FStar.Ghost
open FStar.Seq
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module MTS = MerkleTree.Spec
#set-options "--z3rlimit 10 --max_fuel 0 --max_ifuel 0"
type uint32_t = U32.t
type uint8_t = U8.t
type hash (#hsz:pos) = b:Spec.Hash.Definitions.bytes{Seq... | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
... | [
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FSt... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"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_el... | false | src1: MerkleTree.New.High.hash -> src2: MerkleTree.New.High.hash
-> Prims.GTot MerkleTree.New.High.hash | Prims.GTot | [
"sometrivial"
] | [] | [
"MerkleTree.Spec.sha256_compress"
] | [] | false | false | false | false | false | let sha256_compress =
| MTS.sha256_compress | false |
AlgWP.fst | AlgWP.quotPP | val quotPP (#a #pre #post: _) (f: (unit -> AlgPP a [Read] pre post))
: AlgPP a [Read] pre (fun h0 x h1 -> post h0 x h1 /\ h0 == h1) | val quotPP (#a #pre #post: _) (f: (unit -> AlgPP a [Read] pre post))
: AlgPP a [Read] pre (fun h0 x h1 -> post h0 x h1 /\ h0 == h1) | let quotPP #a #pre #post (f : unit -> AlgPP a [Read] pre post)
: AlgPP a [Read] pre (fun h0 x h1 -> post h0 x h1 /\ h0 == h1)
= quot #_ #(fun h0 p -> pre h0 /\ (forall y h1. post h0 y h1 ==> p (y, h1))) f | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 80,
"end_line": 355,
"start_col": 0,
"start_line": 353
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | f: (_: Prims.unit -> AlgWP.AlgPP a) -> AlgWP.AlgPP a | AlgWP.AlgPP | [] | [] | [
"Alg.state",
"Prims.unit",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"AlgWP.quot",
"FStar.Pervasives.Native.tuple2",
"Prims.logical",
"Prims.l_and",
"Prims.l_Forall",
"Prims.l_imp",
"FStar.Pervasives.Native.Mktuple2",
"Prims.eq2"
] | [] | false | true | false | false | false | let quotPP #a #pre #post (f: (unit -> AlgPP a [Read] pre post))
: AlgPP a [Read] pre (fun h0 x h1 -> post h0 x h1 /\ h0 == h1) =
| quot #_ #(fun h0 p -> pre h0 /\ (forall y h1. post h0 y h1 ==> p (y, h1))) f | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_to_from_mont_id_gen | val lemma_to_from_mont_id_gen (n mont_R mont_R_inv:pos) (a:nat{a < n}) : Lemma
(requires mont_R * mont_R_inv % n = 1)
(ensures (a * mont_R % n) * mont_R_inv % n == a) | val lemma_to_from_mont_id_gen (n mont_R mont_R_inv:pos) (a:nat{a < n}) : Lemma
(requires mont_R * mont_R_inv % n = 1)
(ensures (a * mont_R % n) * mont_R_inv % n == a) | let lemma_to_from_mont_id_gen n mont_R mont_R_inv a =
lemma_mod_mul_assoc n a mont_R mont_R_inv;
Math.Lemmas.modulo_lemma a n | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 30,
"end_line": 43,
"start_col": 0,
"start_line": 41
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R: Prims.pos -> mont_R_inv: Prims.pos -> a: Prims.nat{a < n}
-> FStar.Pervasives.Lemma (requires mont_R * mont_R_inv % n = 1)
(ensures (a * mont_R % n) * mont_R_inv % n == a) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Math.Lemmas.modulo_lemma",
"Prims.unit",
"Hacl.Spec.P256.Montgomery.lemma_mod_mul_assoc"
] | [] | true | false | true | false | false | let lemma_to_from_mont_id_gen n mont_R mont_R_inv a =
| lemma_mod_mul_assoc n a mont_R mont_R_inv;
Math.Lemmas.modulo_lemma a n | false |
AlgWP.fst | AlgWP.null_ro_tree_wp | val null_ro_tree_wp (#a: _) (t: tree a [Read]) : Lemma (null_ro `stronger` (interp_as_wp t)) | val null_ro_tree_wp (#a: _) (t: tree a [Read]) : Lemma (null_ro `stronger` (interp_as_wp t)) | let rec null_ro_tree_wp #a (t : tree a [Read])
: Lemma (null_ro `stronger` (interp_as_wp t))
by (T.compute ()) // need this to trigger some unfoldings
= match t with
| Return x -> ()
| Op Read i k ->
let aux (x:state) : Lemma (null_ro `stronger` interp_as_wp (k x)) =
null_ro_tree_wp (k x)
... | {
"file_name": "examples/layeredeffects/AlgWP.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 378,
"start_col": 0,
"start_line": 368
} | module AlgWP
(* AlgWP: tracking operation labels and WPs. At the end, we show how we
can recover semantic facts from the labels alone, e.g. that interpreting
a tree will not change the state, effectively allowing to strengthen a
WP from intensional information about the operations in the tree. *)
open FStar.List.Tot
... | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"ID5.fst.checked",
"FStar.WellFounded.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Monotonic.Pure.fst.checked",
"FStar.List.Tot.fst.checked",
... | [
{
"abbrev": false,
"full_module": "FStar.Monotonic.Pure",
"short_module": null
},
{
"abbrev": false,
"full_module": "Alg",
"short_module": null
},
{
"abbrev": true,
"full_module": "ID5",
"short_module": "ID5"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.... | {
"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_el... | false | t: Alg.tree a [Alg.Read]
-> FStar.Pervasives.Lemma (ensures AlgWP.stronger AlgWP.null_ro (AlgWP.interp_as_wp t)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Alg.tree",
"Prims.Cons",
"Alg.op",
"Alg.Read",
"Prims.Nil",
"Alg.op_inp",
"Alg.op_out",
"Alg.tree0",
"AlgWP.bind_null_ro",
"Alg.state",
"AlgWP.read_wp",
"AlgWP.interp_as_wp",
"AlgWP.st_wp",
"Prims.unit",
"FStar.Classical.forall_intro",
"AlgWP.stronger",
"AlgWP.null_ro",
"Prims.l_T... | [
"recursion"
] | false | false | true | false | false | let rec null_ro_tree_wp #a (t: tree a [Read])
: Lemma (null_ro `stronger` (interp_as_wp t)) by (T.compute ()) =
| match t with
| Return x -> ()
| Op Read i k ->
let aux (x: state) : Lemma (null_ro `stronger` (interp_as_wp (k x))) = null_ro_tree_wp (k x) in
Classical.forall_intro aux;
bind_null_ro read_wp (fun x -> interp_as_wp (k x)) | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.mont_add_lemma_gen | val mont_add_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma ((a * mont_R_inv % n + b * mont_R_inv % n) % n == (a + b) % n * mont_R_inv % n) | val mont_add_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma ((a * mont_R_inv % n + b * mont_R_inv % n) % n == (a + b) % n * mont_R_inv % n) | let mont_add_lemma_gen n mont_R_inv a b =
calc (==) {
(a * mont_R_inv % n + b * mont_R_inv % n) % n;
(==) { Math.Lemmas.modulo_distributivity (a * mont_R_inv) (b * mont_R_inv) n }
(a * mont_R_inv + b * mont_R_inv) % n;
(==) { Math.Lemmas.distributivity_add_left a b mont_R_inv }
(a + b) * mont_R_in... | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 93,
"start_col": 0,
"start_line": 84
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R_inv: Prims.nat -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures (a * mont_R_inv % n + b * mont_R_inv % n) % n == ((a + b) % n) * mont_R_inv % n) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar... | [] | false | false | true | false | false | let mont_add_lemma_gen n mont_R_inv a b =
| calc ( == ) {
(a * mont_R_inv % n + b * mont_R_inv % n) % n;
( == ) { Math.Lemmas.modulo_distributivity (a * mont_R_inv) (b * mont_R_inv) n }
(a * mont_R_inv + b * mont_R_inv) % n;
( == ) { Math.Lemmas.distributivity_add_left a b mont_R_inv }
(a + b) * mont_R_inv % n;
( == ) { Math.Lemmas.lemma_mod_mul_dist... | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.fmont_R_inv | val fmont_R_inv : pos | val fmont_R_inv : pos | let fmont_R_inv =
let d, _ = SBML.eea_pow2_odd 256 S.prime in d % S.prime | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 161,
"start_col": 0,
"start_line": 160
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | Prims.pos | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Prims.op_Modulus",
"Spec.P256.PointOps.prime",
"Prims.pos",
"FStar.Pervasives.Native.tuple2",
"Hacl.Spec.Montgomery.Lemmas.eea_pow2_odd"
] | [] | false | false | false | true | false | let fmont_R_inv =
| let d, _ = SBML.eea_pow2_odd 256 S.prime in
d % S.prime | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.fmont_sub_lemma | val fmont_sub_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fsub (from_mont a) (from_mont b) = from_mont ((a - b) % S.prime)) | val fmont_sub_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fsub (from_mont a) (from_mont b) = from_mont ((a - b) % S.prime)) | let fmont_sub_lemma a b =
mont_sub_lemma_gen S.prime fmont_R_inv a b | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 230,
"start_col": 0,
"start_line": 229
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem -> b: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.fsub (Hacl.Spec.P256.Montgomery.from_mont a)
(Hacl.Spec.P256.Montgomery.from_mont b) =
Hacl.Spec.P256.Montgomery.from_mont ((a - b) % Spec.P256.PointOps.prime)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Montgomery.mont_sub_lemma_gen",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit"
] | [] | true | false | true | false | false | let fmont_sub_lemma a b =
| mont_sub_lemma_gen S.prime fmont_R_inv a b | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.mont_mul_lemma_gen | val mont_mul_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma (((a * mont_R_inv % n) * (b * mont_R_inv % n)) % n ==
((a * b * mont_R_inv) % n) * mont_R_inv % n) | val mont_mul_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma (((a * mont_R_inv % n) * (b * mont_R_inv % n)) % n ==
((a * b * mont_R_inv) % n) * mont_R_inv % n) | let mont_mul_lemma_gen n mont_R_inv a b =
calc (==) {
((a * mont_R_inv % n) * (b * mont_R_inv % n)) % n;
(==) { Math.Lemmas.lemma_mod_mul_distr_l
(a * mont_R_inv) (b * mont_R_inv % n) n }
(a * mont_R_inv * (b * mont_R_inv % n)) % n;
(==) { Math.Lemmas.lemma_mod_mul_distr_r (a * mont_R_inv) (b * ... | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 78,
"start_col": 0,
"start_line": 58
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R_inv: Prims.nat -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures
(a * mont_R_inv % n) * (b * mont_R_inv % n) % n == ((a * b) * mont_R_inv % n) * mont_R_inv % n
) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.lemma_mod_... | [] | false | false | true | false | false | let mont_mul_lemma_gen n mont_R_inv a b =
| calc ( == ) {
((a * mont_R_inv % n) * (b * mont_R_inv % n)) % n;
( == ) { Math.Lemmas.lemma_mod_mul_distr_l (a * mont_R_inv) (b * mont_R_inv % n) n }
((a * mont_R_inv) * (b * mont_R_inv % n)) % n;
( == ) { Math.Lemmas.lemma_mod_mul_distr_r (a * mont_R_inv) (b * mont_R_inv) n }
((a * mont_R_inv) * (b * mont_R_... | false |
MerkleTree.New.High.fst | MerkleTree.New.High.mt_not_empty | val mt_not_empty (#hsz:pos): merkle_tree #hsz -> GTot bool | val mt_not_empty (#hsz:pos): merkle_tree #hsz -> GTot bool | let mt_not_empty #hsz mt =
MT?.j mt > 0 | {
"file_name": "src/MerkleTree.New.High.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 14,
"end_line": 89,
"start_col": 0,
"start_line": 88
} | module MerkleTree.New.High
open FStar.Ghost
open FStar.Seq
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module MTS = MerkleTree.Spec
#set-options "--z3rlimit 10 --max_fuel 0 --max_ifuel 0"
type uint32_t = U32.t
type uint8_t = U8.t
type hash (#hsz:pos) = b:Spec.Hash.Definitions.bytes{Seq... | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
... | [
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FSt... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"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_el... | false | mt: MerkleTree.New.High.merkle_tree -> Prims.GTot Prims.bool | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.pos",
"MerkleTree.New.High.merkle_tree",
"Prims.op_GreaterThan",
"MerkleTree.New.High.__proj__MT__item__j",
"Prims.bool"
] | [] | false | false | false | false | false | let mt_not_empty #hsz mt =
| MT?.j mt > 0 | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_from_mont_zero | val lemma_from_mont_zero: a:S.felem -> Lemma (from_mont a == 0 <==> a == 0) | val lemma_from_mont_zero: a:S.felem -> Lemma (from_mont a == 0 <==> a == 0) | let lemma_from_mont_zero a =
Spec.P256.Lemmas.prime_lemma ();
Lib.NatMod.lemma_mul_mod_prime_zero #S.prime a fmont_R_inv | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 60,
"end_line": 208,
"start_col": 0,
"start_line": 206
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma (ensures Hacl.Spec.P256.Montgomery.from_mont a == 0 <==> a == 0) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Lib.NatMod.lemma_mul_mod_prime_zero",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit",
"Spec.P256.Lemmas.prime_lemma"
] | [] | true | false | true | false | false | let lemma_from_mont_zero a =
| Spec.P256.Lemmas.prime_lemma ();
Lib.NatMod.lemma_mul_mod_prime_zero #S.prime a fmont_R_inv | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_to_from_mont_id | val lemma_to_from_mont_id: a:S.felem -> Lemma (from_mont (to_mont a) == a) | val lemma_to_from_mont_id: a:S.felem -> Lemma (from_mont (to_mont a) == a) | let lemma_to_from_mont_id a =
mul_fmont_R_and_R_inv_is_one ();
lemma_to_from_mont_id_gen S.prime fmont_R fmont_R_inv a | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 213,
"start_col": 0,
"start_line": 211
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures Hacl.Spec.P256.Montgomery.from_mont (Hacl.Spec.P256.Montgomery.to_mont a) == a) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Montgomery.lemma_to_from_mont_id_gen",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit",
"Hacl.Spec.P256.Montgomery.mul_fmont_R_and_R_inv_is_one"
] | [] | true | false | true | false | false | let lemma_to_from_mont_id a =
| mul_fmont_R_and_R_inv_is_one ();
lemma_to_from_mont_id_gen S.prime fmont_R fmont_R_inv a | false |
MerkleTree.New.High.fst | MerkleTree.New.High.mt_empty | val mt_empty (#hsz:pos): merkle_tree #hsz -> GTot bool | val mt_empty (#hsz:pos): merkle_tree #hsz -> GTot bool | let mt_empty #hsz mt =
MT?.j mt = 0 | {
"file_name": "src/MerkleTree.New.High.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 14,
"end_line": 85,
"start_col": 0,
"start_line": 84
} | module MerkleTree.New.High
open FStar.Ghost
open FStar.Seq
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module MTS = MerkleTree.Spec
#set-options "--z3rlimit 10 --max_fuel 0 --max_ifuel 0"
type uint32_t = U32.t
type uint8_t = U8.t
type hash (#hsz:pos) = b:Spec.Hash.Definitions.bytes{Seq... | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
... | [
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FSt... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"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_el... | false | mt: MerkleTree.New.High.merkle_tree -> Prims.GTot Prims.bool | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.pos",
"MerkleTree.New.High.merkle_tree",
"Prims.op_Equality",
"Prims.int",
"MerkleTree.New.High.__proj__MT__item__j",
"Prims.bool"
] | [] | false | false | false | false | false | let mt_empty #hsz mt =
| MT?.j mt = 0 | false |
MerkleTree.New.High.fst | MerkleTree.New.High.mt_not_full | val mt_not_full (#hsz:pos): merkle_tree #hsz -> GTot bool | val mt_not_full (#hsz:pos): merkle_tree #hsz -> GTot bool | let mt_not_full #hsz mt =
MT?.j mt < pow2 32 - 1 | {
"file_name": "src/MerkleTree.New.High.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 24,
"end_line": 81,
"start_col": 0,
"start_line": 80
} | module MerkleTree.New.High
open FStar.Ghost
open FStar.Seq
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module MTS = MerkleTree.Spec
#set-options "--z3rlimit 10 --max_fuel 0 --max_ifuel 0"
type uint32_t = U32.t
type uint8_t = U8.t
type hash (#hsz:pos) = b:Spec.Hash.Definitions.bytes{Seq... | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"Lib.IntTypes.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
... | [
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FSt... | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"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_el... | false | mt: MerkleTree.New.High.merkle_tree -> Prims.GTot Prims.bool | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.pos",
"MerkleTree.New.High.merkle_tree",
"Prims.op_LessThan",
"MerkleTree.New.High.__proj__MT__item__j",
"Prims.op_Subtraction",
"Prims.pow2",
"Prims.bool"
] | [] | false | false | false | false | false | let mt_not_full #hsz mt =
| MT?.j mt < pow2 32 - 1 | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_prime_mont | val lemma_prime_mont: unit ->
Lemma (S.prime % 2 = 1 /\ S.prime < pow2 256 /\ (1 + S.prime) % pow2 64 = 0) | val lemma_prime_mont: unit ->
Lemma (S.prime % 2 = 1 /\ S.prime < pow2 256 /\ (1 + S.prime) % pow2 64 = 0) | let lemma_prime_mont () =
assert_norm (S.prime % 2 = 1);
assert_norm (S.prime < pow2 256);
assert_norm ((1 + S.prime) % pow2 64 = 0) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 180,
"start_col": 0,
"start_line": 177
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.prime % 2 = 1 /\ Spec.P256.PointOps.prime < Prims.pow2 256 /\
(1 + Spec.P256.PointOps.prime) % Prims.pow2 64 = 0) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Prims.op_Addition",
"Spec.P256.PointOps.prime",
"Prims.pow2",
"Prims.op_LessThan"
] | [] | true | false | true | false | false | let lemma_prime_mont () =
| assert_norm (S.prime % 2 = 1);
assert_norm (S.prime < pow2 256);
assert_norm ((1 + S.prime) % pow2 64 = 0) | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.mul_fmont_R_and_R_inv_is_one | val mul_fmont_R_and_R_inv_is_one: unit -> Lemma (fmont_R * fmont_R_inv % S.prime = 1) | val mul_fmont_R_and_R_inv_is_one: unit -> Lemma (fmont_R * fmont_R_inv % S.prime = 1) | let mul_fmont_R_and_R_inv_is_one () =
let d, k = SBML.eea_pow2_odd 256 S.prime in
SBML.mont_preconditions_d 64 4 S.prime;
assert (d * pow2 256 % S.prime = 1);
Math.Lemmas.lemma_mod_mul_distr_l d (pow2 256) S.prime | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 56,
"end_line": 168,
"start_col": 0,
"start_line": 164
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures
Hacl.Spec.P256.Montgomery.fmont_R * Hacl.Spec.P256.Montgomery.fmont_R_inv %
Spec.P256.PointOps.prime =
1) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"Prims.int",
"FStar.Math.Lemmas.lemma_mod_mul_distr_l",
"Prims.pow2",
"Spec.P256.PointOps.prime",
"Prims._assert",
"Prims.b2t",
"Prims.op_Equality",
"Prims.op_Modulus",
"FStar.Mul.op_Star",
"Hacl.Spec.Montgomery.Lemmas.mont_preconditions_d",
"FStar.Pervasives.Native.tuple2",
"H... | [] | false | false | true | false | false | let mul_fmont_R_and_R_inv_is_one () =
| let d, k = SBML.eea_pow2_odd 256 S.prime in
SBML.mont_preconditions_d 64 4 S.prime;
assert (d * pow2 256 % S.prime = 1);
Math.Lemmas.lemma_mod_mul_distr_l d (pow2 256) S.prime | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.fmont_mul_lemma | val fmont_mul_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fmul (from_mont a) (from_mont b) = from_mont ((a * b * fmont_R_inv) % S.prime)) | val fmont_mul_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fmul (from_mont a) (from_mont b) = from_mont ((a * b * fmont_R_inv) % S.prime)) | let fmont_mul_lemma a b =
mont_mul_lemma_gen S.prime fmont_R_inv a b | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 222,
"start_col": 0,
"start_line": 221
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem -> b: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.fmul (Hacl.Spec.P256.Montgomery.from_mont a)
(Hacl.Spec.P256.Montgomery.from_mont b) =
Hacl.Spec.P256.Montgomery.from_mont ((a * b) * Hacl.Spec.P256.Montgomery.fmont_R_inv %
... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Montgomery.mont_mul_lemma_gen",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit"
] | [] | true | false | true | false | false | let fmont_mul_lemma a b =
| mont_mul_lemma_gen S.prime fmont_R_inv a b | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_mont_inv_gen | val lemma_mont_inv_gen (n:pos{1 < n}) (mont_R:pos) (mont_R_inv:nat{mont_R_inv < n}) (a:nat{a < n}) :
Lemma
(requires M.pow_mod #n mont_R_inv (n - 2) == mont_R % n)
(ensures M.pow_mod #n (a * mont_R_inv % n) (n - 2) == M.pow_mod #n a (n - 2) * mont_R % n) | val lemma_mont_inv_gen (n:pos{1 < n}) (mont_R:pos) (mont_R_inv:nat{mont_R_inv < n}) (a:nat{a < n}) :
Lemma
(requires M.pow_mod #n mont_R_inv (n - 2) == mont_R % n)
(ensures M.pow_mod #n (a * mont_R_inv % n) (n - 2) == M.pow_mod #n a (n - 2) * mont_R % n) | let lemma_mont_inv_gen n mont_R mont_R_inv k =
M.lemma_pow_mod #n (k * mont_R_inv % n) (n - 2);
// assert (M.pow_mod #n (k * mont_R_inv % n) (n - 2) ==
// M.pow (k * mont_R_inv % n) (n - 2) % n);
M.lemma_pow_mod_base (k * mont_R_inv) (n - 2) n;
// == M.pow (k * mont_R_inv) (n - 2) % n
M.lemma_pow_mul_bas... | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 30,
"end_line": 136,
"start_col": 0,
"start_line": 118
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false |
n: Prims.pos{1 < n} ->
mont_R: Prims.pos ->
mont_R_inv: Prims.nat{mont_R_inv < n} ->
a: Prims.nat{a < n}
-> FStar.Pervasives.Lemma (requires Lib.NatMod.pow_mod mont_R_inv (n - 2) == mont_R % n)
(ensures
Lib.NatMod.pow_mod (a * mont_R_inv % n) (n - 2) == Lib.NatMod.pow_mod a (n - 2) * mo... | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.nat",
"Lib.NatMod.lemma_pow_mod",
"Prims.op_Subtraction",
"Prims.unit",
"FStar.Math.Lemmas.lemma_mod_mul_distr_l",
"Lib.NatMod.pow",
"FStar.Math.Lemmas.lemma_mod_mul_distr_r",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Lib.NatMod.pow_m... | [] | true | false | true | false | false | let lemma_mont_inv_gen n mont_R mont_R_inv k =
| M.lemma_pow_mod #n (k * mont_R_inv % n) (n - 2);
M.lemma_pow_mod_base (k * mont_R_inv) (n - 2) n;
M.lemma_pow_mul_base k mont_R_inv (n - 2);
Math.Lemmas.lemma_mod_mul_distr_r (M.pow k (n - 2)) (M.pow mont_R_inv (n - 2)) n;
M.lemma_pow_mod #n mont_R_inv (n - 2);
assert (M.pow_mod #n (k * mont_R_inv % n) (n - 2) == M.pow... | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.fmont_add_lemma | val fmont_add_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fadd (from_mont a) (from_mont b) = from_mont ((a + b) % S.prime)) | val fmont_add_lemma: a:S.felem -> b:S.felem ->
Lemma (S.fadd (from_mont a) (from_mont b) = from_mont ((a + b) % S.prime)) | let fmont_add_lemma a b =
mont_add_lemma_gen S.prime fmont_R_inv a b | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 226,
"start_col": 0,
"start_line": 225
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem -> b: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.fadd (Hacl.Spec.P256.Montgomery.from_mont a)
(Hacl.Spec.P256.Montgomery.from_mont b) =
Hacl.Spec.P256.Montgomery.from_mont ((a + b) % Spec.P256.PointOps.prime)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Montgomery.mont_add_lemma_gen",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit"
] | [] | true | false | true | false | false | let fmont_add_lemma a b =
| mont_add_lemma_gen S.prime fmont_R_inv a b | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.mont_sub_lemma_gen | val mont_sub_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma ((a * mont_R_inv % n - b * mont_R_inv % n) % n == (a - b) % n * mont_R_inv % n) | val mont_sub_lemma_gen (n:pos) (mont_R_inv a b: nat) :
Lemma ((a * mont_R_inv % n - b * mont_R_inv % n) % n == (a - b) % n * mont_R_inv % n) | let mont_sub_lemma_gen n mont_R_inv a b =
calc (==) {
(a * mont_R_inv % n - b * mont_R_inv % n) % n;
(==) { Math.Lemmas.lemma_mod_sub_distr (a * mont_R_inv % n) (b * mont_R_inv) n }
(a * mont_R_inv % n - b * mont_R_inv) % n;
(==) { Math.Lemmas.lemma_mod_plus_distr_l (a * mont_R_inv) (- b * mont_R_inv)... | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 110,
"start_col": 0,
"start_line": 99
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R_inv: Prims.nat -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma
(ensures (a * mont_R_inv % n - b * mont_R_inv % n) % n == ((a - b) % n) * mont_R_inv % n) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"Prims.op_Subtraction",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FS... | [] | false | false | true | false | false | let mont_sub_lemma_gen n mont_R_inv a b =
| calc ( == ) {
(a * mont_R_inv % n - b * mont_R_inv % n) % n;
( == ) { Math.Lemmas.lemma_mod_sub_distr (a * mont_R_inv % n) (b * mont_R_inv) n }
(a * mont_R_inv % n - b * mont_R_inv) % n;
( == ) { Math.Lemmas.lemma_mod_plus_distr_l (a * mont_R_inv) (- b * mont_R_inv) n }
(a * mont_R_inv - b * mont_R_inv) % n;
... | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_from_to_mont_id | val lemma_from_to_mont_id: a:S.felem -> Lemma (to_mont (from_mont a) == a) | val lemma_from_to_mont_id: a:S.felem -> Lemma (to_mont (from_mont a) == a) | let lemma_from_to_mont_id a =
mul_fmont_R_and_R_inv_is_one ();
lemma_from_to_mont_id_gen S.prime fmont_R fmont_R_inv a | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 218,
"start_col": 0,
"start_line": 216
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.felem
-> FStar.Pervasives.Lemma
(ensures Hacl.Spec.P256.Montgomery.to_mont (Hacl.Spec.P256.Montgomery.from_mont a) == a) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.felem",
"Hacl.Spec.P256.Montgomery.lemma_from_to_mont_id_gen",
"Spec.P256.PointOps.prime",
"Hacl.Spec.P256.Montgomery.fmont_R",
"Hacl.Spec.P256.Montgomery.fmont_R_inv",
"Prims.unit",
"Hacl.Spec.P256.Montgomery.mul_fmont_R_and_R_inv_is_one"
] | [] | true | false | true | false | false | let lemma_from_to_mont_id a =
| mul_fmont_R_and_R_inv_is_one ();
lemma_from_to_mont_id_gen S.prime fmont_R fmont_R_inv a | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.qmont_R_inv | val qmont_R_inv : pos | val qmont_R_inv : pos | let qmont_R_inv =
let d, _ = SBML.eea_pow2_odd 256 S.order in d % S.order | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 236,
"start_col": 0,
"start_line": 235
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | Prims.pos | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Prims.op_Modulus",
"Spec.P256.PointOps.order",
"Prims.pos",
"FStar.Pervasives.Native.tuple2",
"Hacl.Spec.Montgomery.Lemmas.eea_pow2_odd"
] | [] | false | false | false | true | false | let qmont_R_inv =
| let d, _ = SBML.eea_pow2_odd 256 S.order in
d % S.order | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_order_mont | val lemma_order_mont: unit ->
Lemma (S.order % 2 = 1 /\ S.order < pow2 256 /\ (1 + S.order * 0xccd1c8aaee00bc4f) % pow2 64 = 0) | val lemma_order_mont: unit ->
Lemma (S.order % 2 = 1 /\ S.order < pow2 256 /\ (1 + S.order * 0xccd1c8aaee00bc4f) % pow2 64 = 0) | let lemma_order_mont () =
assert_norm (S.order % 2 = 1);
assert_norm (S.order < pow2 256);
assert_norm ((1 + S.order * 0xccd1c8aaee00bc4f) % pow2 64 = 0) | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 64,
"end_line": 256,
"start_col": 0,
"start_line": 253
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures
Spec.P256.PointOps.order % 2 = 1 /\ Spec.P256.PointOps.order < Prims.pow2 256 /\
(1 + Spec.P256.PointOps.order * 0xccd1c8aaee00bc4f) % Prims.pow2 64 = 0) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Spec.P256.PointOps.order",
"Prims.pow2",
"Prims.op_LessThan"
] | [] | true | false | true | false | false | let lemma_order_mont () =
| assert_norm (S.order % 2 = 1);
assert_norm (S.order < pow2 256);
assert_norm ((1 + S.order * 0xccd1c8aaee00bc4f) % pow2 64 = 0) | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.mont_cancel_lemma_gen | val mont_cancel_lemma_gen (n:pos) (mont_R mont_R_inv a b:nat) : Lemma
(requires mont_R_inv * mont_R % n = 1)
(ensures (a * mont_R % n * b * mont_R_inv) % n = a * b % n) | val mont_cancel_lemma_gen (n:pos) (mont_R mont_R_inv a b:nat) : Lemma
(requires mont_R_inv * mont_R % n = 1)
(ensures (a * mont_R % n * b * mont_R_inv) % n = a * b % n) | let mont_cancel_lemma_gen n mont_R mont_R_inv a b =
calc (==) {
(a * mont_R % n * b * mont_R_inv) % n;
(==) { Math.Lemmas.paren_mul_right (a * mont_R % n) b mont_R_inv }
(a * mont_R % n * (b * mont_R_inv)) % n;
(==) { Math.Lemmas.lemma_mod_mul_distr_l (a * mont_R) (b * mont_R_inv) n }
(a * mont_R ... | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 157,
"start_col": 0,
"start_line": 139
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | n: Prims.pos -> mont_R: Prims.nat -> mont_R_inv: Prims.nat -> a: Prims.nat -> b: Prims.nat
-> FStar.Pervasives.Lemma (requires mont_R_inv * mont_R % n = 1)
(ensures ((a * mont_R % n) * b) * mont_R_inv % n = a * b % n) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"Prims.nat",
"FStar.Calc.calc_finish",
"Prims.int",
"Prims.eq2",
"Prims.op_Modulus",
"FStar.Mul.op_Star",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.paren_mul_... | [] | false | false | true | false | false | let mont_cancel_lemma_gen n mont_R mont_R_inv a b =
| calc ( == ) {
(((a * mont_R % n) * b) * mont_R_inv) % n;
( == ) { Math.Lemmas.paren_mul_right (a * mont_R % n) b mont_R_inv }
((a * mont_R % n) * (b * mont_R_inv)) % n;
( == ) { Math.Lemmas.lemma_mod_mul_distr_l (a * mont_R) (b * mont_R_inv) n }
((a * mont_R) * (b * mont_R_inv)) % n;
( == ) { (Math.Lemmas.p... | false |
Hacl.Spec.P256.Montgomery.fst | Hacl.Spec.P256.Montgomery.lemma_from_to_qmont_id | val lemma_from_to_qmont_id: a:S.qelem -> Lemma (to_qmont (from_qmont a) == a) | val lemma_from_to_qmont_id: a:S.qelem -> Lemma (to_qmont (from_qmont a) == a) | let lemma_from_to_qmont_id a =
mul_qmont_R_and_R_inv_is_one ();
Math.Lemmas.swap_mul qmont_R qmont_R_inv;
lemma_from_to_mont_id_gen S.order qmont_R qmont_R_inv a | {
"file_name": "code/ecdsap256/Hacl.Spec.P256.Montgomery.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 57,
"end_line": 291,
"start_col": 0,
"start_line": 288
} | module Hacl.Spec.P256.Montgomery
open FStar.Mul
open Lib.IntTypes
module S = Spec.P256
module M = Lib.NatMod
module BD = Hacl.Spec.Bignum.Definitions
module SBM = Hacl.Spec.Bignum.Montgomery
module SBML = Hacl.Spec.Montgomery.Lemmas
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Montgomery arithmetic for a b... | {
"checked_file": "/",
"dependencies": [
"Spec.P256.Lemmas.fsti.checked",
"Spec.P256.fst.checked",
"prims.fst.checked",
"Lib.NatMod.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Montgomery.Lemmas.fst.checked",
"Hacl.Spec.Bignum.Montgomery.fsti.checked",
"Hacl.Spec.Bignum.Def... | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Montgomery.Lemmas",
"short_module": "SBML"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Montgomery",
"short_module": "SBM"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
... | {
"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_el... | false | a: Spec.P256.PointOps.qelem
-> FStar.Pervasives.Lemma
(ensures Hacl.Spec.P256.Montgomery.to_qmont (Hacl.Spec.P256.Montgomery.from_qmont a) == a) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Spec.P256.PointOps.qelem",
"Hacl.Spec.P256.Montgomery.lemma_from_to_mont_id_gen",
"Spec.P256.PointOps.order",
"Hacl.Spec.P256.Montgomery.qmont_R",
"Hacl.Spec.P256.Montgomery.qmont_R_inv",
"Prims.unit",
"FStar.Math.Lemmas.swap_mul",
"Hacl.Spec.P256.Montgomery.mul_qmont_R_and_R_inv_is_one"
] | [] | true | false | true | false | false | let lemma_from_to_qmont_id a =
| mul_qmont_R_and_R_inv_is_one ();
Math.Lemmas.swap_mul qmont_R qmont_R_inv;
lemma_from_to_mont_id_gen S.order qmont_R qmont_R_inv a | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.