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
sequencelengths 0
2
| mutual_with
sequencelengths 0
11
| ideal_premises
sequencelengths 0
236
| proof_features
sequencelengths 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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.parse_int32le | val parse_int32le:parser (total_constant_size_parser_kind 4) U32.t | val parse_int32le:parser (total_constant_size_parser_kind 4) U32.t | let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 56,
"end_line": 53,
"start_col": 0,
"start_line": 51
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | LowParse.Spec.Base.parser (LowParse.Spec.Base.total_constant_size_parser_kind 4) FStar.UInt32.t | Prims.Tot | [
"total"
] | [] | [
"LowParse.Spec.Combinators.make_total_constant_size_parser",
"FStar.UInt32.t",
"LowParse.Spec.Int32le.decode_int32le",
"Prims.unit",
"LowParse.Spec.Int32le.decode_int32le_total_constant"
] | [] | false | false | false | false | false | let parse_int32le:parser (total_constant_size_parser_kind 4) U32.t =
| decode_int32le_total_constant ();
make_total_constant_size_parser 4 U32.t decode_int32le | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.decode_int32le | val decode_int32le (b: bytes{Seq.length b == 4})
: Tot (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296}) | val decode_int32le (b: bytes{Seq.length b == 4})
: Tot (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296}) | let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 19,
"end_line": 28,
"start_col": 0,
"start_line": 21
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 4}
-> v: FStar.UInt32.t{0 <= FStar.UInt32.v v /\ FStar.UInt32.v v < 4294967296} | Prims.Tot | [
"total"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"FStar.UInt32.uint_to_t",
"Prims.unit",
"Prims._assert",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.nat",
"FStar.Endianness.le_to_n",
"FStar.Math.Lemmas.pow2_le_compat",
"FStar.Endianness.lemma_le_to_n_is_bounded",
"FStar.UInt32.t",
"FStar.UInt32.v"
] | [] | false | false | false | false | false | let decode_int32le (b: bytes{Seq.length b == 4})
: Tot (v: U32.t{0 <= U32.v v /\ U32.v v < 4294967296}) =
| lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res | false |
LowParse.Slice.fst | LowParse.Slice.make_slice | val make_slice (#rrel #rel: _) (b: B.mbuffer byte rrel rel) (len: U32.t{U32.v len <= B.length b})
: Tot (slice (srel_of_buffer_srel rrel) (srel_of_buffer_srel rel)) | val make_slice (#rrel #rel: _) (b: B.mbuffer byte rrel rel) (len: U32.t{U32.v len <= B.length b})
: Tot (slice (srel_of_buffer_srel rrel) (srel_of_buffer_srel rel)) | let make_slice
(#rrel #rel: _)
(b: B.mbuffer byte rrel rel)
(len: U32.t { U32.v len <= B.length b } )
: Tot (slice (srel_of_buffer_srel rrel) (srel_of_buffer_srel rel))
= {
base = b;
len = len;
} | {
"file_name": "src/lowparse/LowParse.Slice.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 1,
"end_line": 44,
"start_col": 0,
"start_line": 36
} | module LowParse.Slice
open LowParse.Bytes
module B = LowStar.Monotonic.Buffer
module U32 = FStar.UInt32
module HS = FStar.HyperStack
inline_for_extraction
noextract
type srel (a: Type) = (B.srel a)
inline_for_extraction
noextract
let buffer_srel_of_srel (#a: Type) (s: srel a) : Tot (B.srel a) =
s
inline_for_extraction
noextract
let srel_of_buffer_srel (#a: Type) (s: B.srel a) : Tot (srel a) =
s
let buffer_srel_of_srel_of_buffer_srel (#a: Type) (s: B.srel a) : Lemma
(buffer_srel_of_srel (srel_of_buffer_srel s) == s)
[SMTPat (buffer_srel_of_srel (srel_of_buffer_srel s))]
= ()
noeq
inline_for_extraction
type slice (rrel rel: srel byte) = {
base: B.mbuffer byte (buffer_srel_of_srel rrel) (buffer_srel_of_srel rel);
len: (len: U32.t { U32.v len <= B.length base } );
}
inline_for_extraction | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Monotonic.Buffer.fsti.checked",
"LowParse.Bytes.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Slice.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Bytes",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
b: LowStar.Monotonic.Buffer.mbuffer LowParse.Bytes.byte rrel rel ->
len: FStar.UInt32.t{FStar.UInt32.v len <= LowStar.Monotonic.Buffer.length b}
-> LowParse.Slice.slice (LowParse.Slice.srel_of_buffer_srel rrel)
(LowParse.Slice.srel_of_buffer_srel rel) | Prims.Tot | [
"total"
] | [] | [
"LowStar.Monotonic.Buffer.srel",
"LowParse.Bytes.byte",
"LowStar.Monotonic.Buffer.mbuffer",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"LowStar.Monotonic.Buffer.length",
"LowParse.Slice.Mkslice",
"LowParse.Slice.srel_of_buffer_srel",
"LowParse.Slice.slice"
] | [] | false | false | false | false | false | let make_slice (#rrel #rel: _) (b: B.mbuffer byte rrel rel) (len: U32.t{U32.v len <= B.length b})
: Tot (slice (srel_of_buffer_srel rrel) (srel_of_buffer_srel rel)) =
| { base = b; len = len } | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.le_to_n_0_eq | val le_to_n_0_eq (b: bytes{Seq.length b == 0}) : Lemma (le_to_n b == 0) | val le_to_n_0_eq (b: bytes{Seq.length b == 0}) : Lemma (le_to_n b == 0) | let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 18,
"end_line": 63,
"start_col": 0,
"start_line": 60
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 0}
-> FStar.Pervasives.Lemma (ensures FStar.Endianness.le_to_n b == 0) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"FStar.Endianness.reveal_le_to_n",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"FStar.Endianness.le_to_n",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let le_to_n_0_eq (b: bytes{Seq.length b == 0}) : Lemma (le_to_n b == 0) =
| reveal_le_to_n b | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.decode_int32le_total_constant | val decode_int32le_total_constant: Prims.unit
-> Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le) | val decode_int32le_total_constant: Prims.unit
-> Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le) | let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 51,
"end_line": 49,
"start_col": 0,
"start_line": 48
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
() | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Combinators.make_total_constant_size_parser_precond 4
FStar.UInt32.t
LowParse.Spec.Int32le.decode_int32le) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.unit",
"FStar.Classical.forall_intro_2",
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"Prims.l_imp",
"FStar.UInt32.t",
"Prims.l_or",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"Prims.op_LessThan",
"LowParse.Spec.Int32le.decode_int32le",
"LowParse.Spec.Int32le.decode_int32le_injective",
"Prims.l_True",
"Prims.squash",
"LowParse.Spec.Combinators.make_total_constant_size_parser_precond",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | false | false | true | false | false | let decode_int32le_total_constant ()
: Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le) =
| Classical.forall_intro_2 decode_int32le_injective | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.equal | val equal (#a:Type) (m1 m2:map16 a) : Type0 | val equal (#a:Type) (m1 m2:map16 a) : Type0 | let equal #a m1 m2 = m1 == m2 | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 67,
"start_col": 0,
"start_line": 67
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m1: Vale.Lib.Map16.map16 a -> m2: Vale.Lib.Map16.map16 a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Lib.Map16.map16",
"Prims.eq2"
] | [] | false | false | false | true | true | let equal #a m1 m2 =
| m1 == m2 | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.serialize_int32le | val serialize_int32le:serializer parse_int32le | val serialize_int32le:serializer parse_int32le | let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x) | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 40,
"end_line": 56,
"start_col": 0,
"start_line": 55
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | LowParse.Spec.Base.serializer LowParse.Spec.Int32le.parse_int32le | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.t",
"FStar.Endianness.n_to_le",
"FStar.UInt32.v",
"FStar.Endianness.bytes",
"Prims.l_and",
"Prims.eq2",
"Prims.nat",
"FStar.Seq.Base.length",
"FStar.UInt8.t",
"FStar.Endianness.le_to_n"
] | [] | false | false | false | false | false | let serialize_int32le:serializer parse_int32le =
| fun (x: U32.t) -> n_to_le 4 (U32.v x) | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.le_to_n_2_eq | val le_to_n_2_eq (b: bytes{Seq.length b == 2})
: Lemma (le_to_n b == U8.v (Seq.index b 0) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1))) | val le_to_n_2_eq (b: bytes{Seq.length b == 2})
: Lemma (le_to_n b == U8.v (Seq.index b 0) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1))) | let le_to_n_2_eq
(b : bytes { Seq.length b == 2 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1)))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_1_eq (Seq.tail b) | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 27,
"end_line": 80,
"start_col": 0,
"start_line": 73
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *)
let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b
let le_to_n_1_eq
(b : bytes { Seq.length b == 1 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 2}
-> FStar.Pervasives.Lemma
(ensures
FStar.Endianness.le_to_n b ==
FStar.UInt8.v (FStar.Seq.Base.index b 0) + 256 * FStar.UInt8.v (FStar.Seq.Base.index b 1)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Int32le.le_to_n_1_eq",
"FStar.Seq.Properties.tail",
"Prims.unit",
"FStar.Endianness.reveal_le_to_n",
"FStar.Pervasives.assert_norm",
"Prims.pow2",
"Prims.l_True",
"Prims.squash",
"FStar.Endianness.le_to_n",
"Prims.op_Addition",
"FStar.UInt8.v",
"FStar.Seq.Base.index",
"FStar.Mul.op_Star",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let le_to_n_2_eq (b: bytes{Seq.length b == 2})
: Lemma (le_to_n b == U8.v (Seq.index b 0) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1))) =
| assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_1_eq (Seq.tail b) | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.le_to_n_3_eq | val le_to_n_3_eq (b: bytes{Seq.length b == 3})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2)))) | val le_to_n_3_eq (b: bytes{Seq.length b == 3})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2)))) | let le_to_n_3_eq
(b : bytes { Seq.length b == 3 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2))))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_2_eq (Seq.tail b) | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 27,
"end_line": 90,
"start_col": 0,
"start_line": 82
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *)
let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b
let le_to_n_1_eq
(b : bytes { Seq.length b == 1 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b)
let le_to_n_2_eq
(b : bytes { Seq.length b == 2 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1)))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_1_eq (Seq.tail b) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 3}
-> FStar.Pervasives.Lemma
(ensures
FStar.Endianness.le_to_n b ==
FStar.UInt8.v (FStar.Seq.Base.index b 0) +
256 *
(FStar.UInt8.v (FStar.Seq.Base.index b 1) + 256 * FStar.UInt8.v (FStar.Seq.Base.index b 2))) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Int32le.le_to_n_2_eq",
"FStar.Seq.Properties.tail",
"Prims.unit",
"FStar.Endianness.reveal_le_to_n",
"FStar.Pervasives.assert_norm",
"Prims.pow2",
"Prims.l_True",
"Prims.squash",
"FStar.Endianness.le_to_n",
"Prims.op_Addition",
"FStar.UInt8.v",
"FStar.Seq.Base.index",
"FStar.Mul.op_Star",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let le_to_n_3_eq (b: bytes{Seq.length b == 3})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2)))) =
| assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_2_eq (Seq.tail b) | false |
FStar.Pervasives.fst | FStar.Pervasives.spinoff | val spinoff (p: Type0) : Type0 | val spinoff (p: Type0) : Type0 | let spinoff p = p | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 29,
"start_col": 0,
"start_line": 29
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: Type0 -> Type0 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | true | let spinoff p =
| p | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.le_to_n_1_eq | val le_to_n_1_eq (b: bytes{Seq.length b == 1}) : Lemma (le_to_n b == U8.v (Seq.index b 0)) | val le_to_n_1_eq (b: bytes{Seq.length b == 1}) : Lemma (le_to_n b == U8.v (Seq.index b 0)) | let le_to_n_1_eq
(b : bytes { Seq.length b == 1 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b) | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 27,
"end_line": 71,
"start_col": 0,
"start_line": 65
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *)
let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 1}
-> FStar.Pervasives.Lemma
(ensures FStar.Endianness.le_to_n b == FStar.UInt8.v (FStar.Seq.Base.index b 0)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Int32le.le_to_n_0_eq",
"FStar.Seq.Properties.tail",
"Prims.unit",
"FStar.Endianness.reveal_le_to_n",
"FStar.Pervasives.assert_norm",
"Prims.pow2",
"Prims.l_True",
"Prims.squash",
"Prims.l_or",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt8.n",
"FStar.Endianness.le_to_n",
"FStar.UInt8.v",
"FStar.Seq.Base.index",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let le_to_n_1_eq (b: bytes{Seq.length b == 1}) : Lemma (le_to_n b == U8.v (Seq.index b 0)) =
| assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b) | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.decode_int32le_injective | val decode_int32le_injective (b1: bytes{Seq.length b1 == 4}) (b2: bytes{Seq.length b2 == 4})
: Lemma (decode_int32le b1 == decode_int32le b2 ==> b1 == b2) | val decode_int32le_injective (b1: bytes{Seq.length b1 == 4}) (b2: bytes{Seq.length b2 == 4})
: Lemma (decode_int32le b1 == decode_int32le b2 ==> b1 == b2) | let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
() | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 6,
"end_line": 46,
"start_col": 0,
"start_line": 30
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
b1: LowParse.Bytes.bytes{FStar.Seq.Base.length b1 == 4} ->
b2: LowParse.Bytes.bytes{FStar.Seq.Base.length b2 == 4}
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Int32le.decode_int32le b1 == LowParse.Spec.Int32le.decode_int32le b2 ==>
b1 == b2) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"Prims.op_Equality",
"FStar.UInt32.t",
"Prims.l_or",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"Prims.op_LessThan",
"LowParse.Spec.Int32le.decode_int32le",
"FStar.Endianness.le_to_n_inj",
"Prims.unit",
"Prims._assert",
"Prims.nat",
"FStar.Endianness.le_to_n",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.UInt32.uint_to_t",
"FStar.Endianness.lemma_le_to_n_is_bounded",
"Prims.bool",
"Prims.l_True",
"Prims.squash",
"Prims.l_imp",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | false | false | true | false | false | let decode_int32le_injective (b1: bytes{Seq.length b1 == 4}) (b2: bytes{Seq.length b2 == 4})
: Lemma (decode_int32le b1 == decode_int32le b2 ==> b1 == b2) =
| if (decode_int32le b1) = (decode_int32le b2)
then
(lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2) | false |
FStar.Pervasives.fst | FStar.Pervasives.ambient | val ambient (#a: Type) (x: a) : Type0 | val ambient (#a: Type) (x: a) : Type0 | let ambient #_ _ = True | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 23,
"end_line": 38,
"start_col": 0,
"start_line": 38
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: a -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.l_True"
] | [] | false | false | false | true | true | let ambient #_ _ =
| True | false |
FStar.Pervasives.fst | FStar.Pervasives.normalize | val normalize (a: Type0) : Type0 | val normalize (a: Type0) : Type0 | let normalize a = a | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 19,
"end_line": 44,
"start_col": 0,
"start_line": 44
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type0 -> Type0 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | true | let normalize a =
| a | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.le_to_n_4_eq | val le_to_n_4_eq (b: bytes{Seq.length b == 4})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) | val le_to_n_4_eq (b: bytes{Seq.length b == 4})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) | let le_to_n_4_eq
(b : bytes { Seq.length b == 4 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3)))))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_3_eq (Seq.tail b) | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 27,
"end_line": 101,
"start_col": 0,
"start_line": 92
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *)
let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b
let le_to_n_1_eq
(b : bytes { Seq.length b == 1 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b)
let le_to_n_2_eq
(b : bytes { Seq.length b == 2 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1)))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_1_eq (Seq.tail b)
let le_to_n_3_eq
(b : bytes { Seq.length b == 3 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2))))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_2_eq (Seq.tail b) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 4}
-> FStar.Pervasives.Lemma
(ensures
FStar.Endianness.le_to_n b ==
FStar.UInt8.v (FStar.Seq.Base.index b 0) +
256 *
(FStar.UInt8.v (FStar.Seq.Base.index b 1) +
256 *
(FStar.UInt8.v (FStar.Seq.Base.index b 2) + 256 * FStar.UInt8.v (FStar.Seq.Base.index b 3)))
) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Int32le.le_to_n_3_eq",
"FStar.Seq.Properties.tail",
"Prims.unit",
"FStar.Endianness.reveal_le_to_n",
"FStar.Pervasives.assert_norm",
"Prims.pow2",
"Prims.l_True",
"Prims.squash",
"FStar.Endianness.le_to_n",
"Prims.op_Addition",
"FStar.UInt8.v",
"FStar.Seq.Base.index",
"FStar.Mul.op_Star",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let le_to_n_4_eq (b: bytes{Seq.length b == 4})
: Lemma
(le_to_n b ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) =
| assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_3_eq (Seq.tail b) | false |
FStar.Pervasives.fst | FStar.Pervasives.normalize_term | val normalize_term (#a: Type) (x: a) : Tot a | val normalize_term (#a: Type) (x: a) : Tot a | let normalize_term #_ x = x | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 27,
"end_line": 42,
"start_col": 0,
"start_line": 42
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: a -> a | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let normalize_term #_ x =
| x | false |
FStar.Pervasives.fst | FStar.Pervasives.simplify | val simplify : norm_step | val simplify : norm_step | let simplify = Simpl | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 20,
"end_line": 71,
"start_col": 0,
"start_line": 71
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Simpl"
] | [] | false | false | false | true | false | let simplify =
| Simpl | false |
FStar.Pervasives.fst | FStar.Pervasives.weak | val weak : norm_step | val weak : norm_step | let weak = Weak | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 15,
"end_line": 74,
"start_col": 0,
"start_line": 74
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Weak"
] | [] | false | false | false | true | false | let weak =
| Weak | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_equal | val lemma_equal (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel m1 i) \/ (sel m2 i)} 0 <= i /\ i < 16 ==> sel m1 i == sel m2 i))
(ensures m1 == m2) | val lemma_equal (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel m1 i) \/ (sel m2 i)} 0 <= i /\ i < 16 ==> sel m1 i == sel m2 i))
(ensures m1 == m2) | let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2 | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 40,
"start_col": 0,
"start_line": 37
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m1: Vale.Lib.Map16.map16 a -> m2: Vale.Lib.Map16.map16 a
-> FStar.Pervasives.Lemma
(requires
forall (i: Prims.int). {:pattern Vale.Lib.Map16.sel m1 i\/Vale.Lib.Map16.sel m2 i}
0 <= i /\ i < 16 ==> Vale.Lib.Map16.sel m1 i == Vale.Lib.Map16.sel m2 i)
(ensures m1 == m2) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Vale.Lib.Map16.lemma_equal16",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.l_Forall",
"Prims.int",
"Prims.eq2",
"Vale.Lib.Map16.sel",
"Vale.Lib.Map16.sel16"
] | [] | false | false | true | false | false | let lemma_equal (#a: Type) (m1 m2: map16 a) =
| assert_norm (forall (i: int). sel m1 i == sel16 m1 i);
assert_norm (forall (i: int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2 | false |
FStar.Pervasives.fst | FStar.Pervasives.delta | val delta : norm_step | val delta : norm_step | let delta = Delta | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 83,
"start_col": 0,
"start_line": 83
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Delta"
] | [] | false | false | false | true | false | let delta =
| Delta | false |
FStar.Pervasives.fst | FStar.Pervasives.primops | val primops : norm_step | val primops : norm_step | let primops = Primops | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 21,
"end_line": 80,
"start_col": 0,
"start_line": 80
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Primops"
] | [] | false | false | false | true | false | let primops =
| Primops | false |
FStar.Pervasives.fst | FStar.Pervasives.norm_debug | val norm_debug : norm_step | val norm_debug : norm_step | let norm_debug = NormDebug | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 26,
"end_line": 86,
"start_col": 0,
"start_line": 86
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.NormDebug"
] | [] | false | false | false | true | false | let norm_debug =
| NormDebug | false |
FStar.Pervasives.fst | FStar.Pervasives.hnf | val hnf : norm_step | val hnf : norm_step | let hnf = HNF | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 77,
"start_col": 0,
"start_line": 77
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.HNF"
] | [] | false | false | false | true | false | let hnf =
| HNF | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_other | val lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) : Lemma
(requires 0 <= n1 /\ n1 < 16 /\ 0 <= n2 /\ n2 < 16 /\ n1 =!= n2)
(ensures sel (upd m n1 v) n2 == sel m n2)
[SMTPat (sel (upd m n1 v) n2)] | val lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) : Lemma
(requires 0 <= n1 /\ n1 < 16 /\ 0 <= n2 /\ n2 < 16 /\ n1 =!= n2)
(ensures sel (upd m n1 v) n2 == sel m n2)
[SMTPat (sel (upd m n1 v) n2)] | let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 35,
"start_col": 0,
"start_line": 32
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: Vale.Lib.Map16.map16 a -> n1: Prims.int -> n2: Prims.int -> v: a
-> FStar.Pervasives.Lemma (requires 0 <= n1 /\ n1 < 16 /\ 0 <= n2 /\ n2 < 16 /\ ~(n1 == n2))
(ensures Vale.Lib.Map16.sel (Vale.Lib.Map16.upd m n1 v) n2 == Vale.Lib.Map16.sel m n2)
[SMTPat (Vale.Lib.Map16.sel (Vale.Lib.Map16.upd m n1 v) n2)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Prims.int",
"Vale.Lib.Map16.lemma_other16",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Vale.Lib.Map16.sel",
"Vale.Lib.Map16.sel16",
"Vale.Lib.Map16.upd",
"Vale.Lib.Map16.upd16"
] | [] | true | false | true | false | false | let lemma_other (#a: Type) (m: map16 a) (n1 n2: int) (v: a) =
| assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v | false |
FStar.Pervasives.fst | FStar.Pervasives.iota | val iota : norm_step | val iota : norm_step | let iota = Iota | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 15,
"end_line": 95,
"start_col": 0,
"start_line": 95
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Iota"
] | [] | false | false | false | true | false | let iota =
| Iota | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_self | val lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) : Lemma
(requires 0 <= n /\ n < 16)
(ensures sel (upd m n v) n == v)
[SMTPat (sel (upd m n v) n)] | val lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) : Lemma
(requires 0 <= n /\ n < 16)
(ensures sel (upd m n v) n == v)
[SMTPat (sel (upd m n v) n)] | let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 20,
"end_line": 30,
"start_col": 0,
"start_line": 28
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: Vale.Lib.Map16.map16 a -> n: Prims.int -> v: a
-> FStar.Pervasives.Lemma (requires 0 <= n /\ n < 16)
(ensures Vale.Lib.Map16.sel (Vale.Lib.Map16.upd m n v) n == v)
[SMTPat (Vale.Lib.Map16.sel (Vale.Lib.Map16.upd m n v) n)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Prims.int",
"Vale.Lib.Map16.lemma_self16",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Vale.Lib.Map16.sel",
"Vale.Lib.Map16.upd",
"Vale.Lib.Map16.sel16",
"Vale.Lib.Map16.upd16"
] | [] | true | false | true | false | false | let lemma_self (#a: Type) (m: map16 a) (n: int) (v: a) =
| assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v | false |
FStar.Pervasives.fst | FStar.Pervasives.zeta | val zeta : norm_step | val zeta : norm_step | let zeta = Zeta | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 15,
"end_line": 89,
"start_col": 0,
"start_line": 89
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Zeta"
] | [] | false | false | false | true | false | let zeta =
| Zeta | false |
FStar.Pervasives.fst | FStar.Pervasives.zeta_full | val zeta_full : norm_step | val zeta_full : norm_step | let zeta_full = ZetaFull | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 24,
"end_line": 92,
"start_col": 0,
"start_line": 92
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.ZetaFull"
] | [] | false | false | false | true | false | let zeta_full =
| ZetaFull | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_equal16 | val lemma_equal16 (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel16 m1 i) \/ (sel16 m2 i)} 0 <= i /\ i < 16 ==> sel16 m1 i == sel16 m2 i))
(ensures m1 == m2) | val lemma_equal16 (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel16 m1 i) \/ (sel16 m2 i)} 0 <= i /\ i < 16 ==> sel16 m1 i == sel16 m2 i))
(ensures m1 == m2) | let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
() | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 4,
"end_line": 25,
"start_col": 0,
"start_line": 8
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 5,
"max_fuel": 1,
"max_ifuel": 5,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m1: Vale.Lib.Map16.map16 a -> m2: Vale.Lib.Map16.map16 a
-> FStar.Pervasives.Lemma
(requires
forall (i: Prims.int). {:pattern Vale.Lib.Map16.sel16 m1 i\/Vale.Lib.Map16.sel16 m2 i}
0 <= i /\ i < 16 ==> Vale.Lib.Map16.sel16 m1 i == Vale.Lib.Map16.sel16 m2 i)
(ensures m1 == m2) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Vale.Lib.Map16.sel16"
] | [] | true | false | true | false | false | let lemma_equal16 (#a: Type) (m1 m2: map16 a) =
| assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
() | false |
FStar.Pervasives.fst | FStar.Pervasives.nbe | val nbe : norm_step | val nbe : norm_step | let nbe = NBE | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 98,
"start_col": 0,
"start_line": 98
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.NBE"
] | [] | false | false | false | true | false | let nbe =
| NBE | false |
FStar.Pervasives.fst | FStar.Pervasives.reify_ | val reify_ : norm_step | val reify_ : norm_step | let reify_ = Reify | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 18,
"end_line": 101,
"start_col": 0,
"start_line": 101
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Reify"
] | [] | false | false | false | true | false | let reify_ =
| Reify | false |
LowParse.Spec.Int32le.fst | LowParse.Spec.Int32le.decode_int32le_eq | val decode_int32le_eq (b: bytes{Seq.length b == 4})
: Lemma
(U32.v (decode_int32le b) ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) | val decode_int32le_eq (b: bytes{Seq.length b == 4})
: Lemma
(U32.v (decode_int32le b) ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) | let decode_int32le_eq
(b : bytes { Seq.length b == 4 } )
: Lemma
(U32.v (decode_int32le b) ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3)))))
= lemma_le_to_n_is_bounded b;
assert (U32.v (decode_int32le b) == le_to_n b);
le_to_n_4_eq b | {
"file_name": "src/lowparse/LowParse.Spec.Int32le.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 16,
"end_line": 113,
"start_col": 0,
"start_line": 103
} | module LowParse.Spec.Int32le
(* LowParse specification module for parsing unconstrainted 32 bits = 4 bytes unsigned little endian integers
Examples:
uint32le foo
*)
include FStar.Endianness
include LowParse.Spec.Base
include LowParse.Spec.Combinators
module U32 = FStar.UInt32
module U8 = FStar.UInt8
module Seq = FStar.Seq
module M = LowParse.Math
let decode_int32le
(b: bytes { Seq.length b == 4 } )
: Tot (v: U32.t { 0 <= U32.v v /\ U32.v v < 4294967296 } )
= lemma_le_to_n_is_bounded b;
M.pow2_le_compat 32 32;
let res = le_to_n b in
assert (0 <= res /\ res < 4294967296);
U32.uint_to_t res
let decode_int32le_injective
(b1 : bytes { Seq.length b1 == 4 } )
(b2 : bytes { Seq.length b2 == 4 } )
: Lemma (decode_int32le b1 == decode_int32le b2
==>
b1 == b2)
= if (decode_int32le b1) = (decode_int32le b2) then
begin
lemma_le_to_n_is_bounded b1;
lemma_le_to_n_is_bounded b2;
assert (U32.v (U32.uint_to_t (le_to_n b1)) == le_to_n b1);
assert (U32.v (U32.uint_to_t (le_to_n b2)) == le_to_n b2);
assert (le_to_n b1 == le_to_n b2);
le_to_n_inj b1 b2
end
else
()
let decode_int32le_total_constant () : Lemma (make_total_constant_size_parser_precond 4 U32.t decode_int32le)
= Classical.forall_intro_2 decode_int32le_injective
let parse_int32le : parser (total_constant_size_parser_kind 4) U32.t
= decode_int32le_total_constant () ;
make_total_constant_size_parser 4 U32.t decode_int32le
let serialize_int32le : serializer parse_int32le
= fun (x : U32.t) -> n_to_le 4 (U32.v x)
(* lemmas for inplace comparison in validators *)
let le_to_n_0_eq
(b : bytes { Seq.length b == 0 } )
: Lemma (le_to_n b == 0)
= reveal_le_to_n b
let le_to_n_1_eq
(b : bytes { Seq.length b == 1 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_0_eq (Seq.tail b)
let le_to_n_2_eq
(b : bytes { Seq.length b == 2 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1)))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_1_eq (Seq.tail b)
let le_to_n_3_eq
(b : bytes { Seq.length b == 3 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2))))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_2_eq (Seq.tail b)
let le_to_n_4_eq
(b : bytes { Seq.length b == 4 } )
: Lemma (le_to_n b ==
U8.v (Seq.index b 0) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 1) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 2) +
256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3)))))
= assert_norm (pow2 8 == 256);
reveal_le_to_n b;
le_to_n_3_eq (Seq.tail b) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.Base.fsti.checked",
"LowParse.Math.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Endianness.fsti.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.Int32le.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.Math",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Endianness",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | b: LowParse.Bytes.bytes{FStar.Seq.Base.length b == 4}
-> FStar.Pervasives.Lemma
(ensures
FStar.UInt32.v (LowParse.Spec.Int32le.decode_int32le b) ==
FStar.UInt8.v (FStar.Seq.Base.index b 0) +
256 *
(FStar.UInt8.v (FStar.Seq.Base.index b 1) +
256 *
(FStar.UInt8.v (FStar.Seq.Base.index b 2) + 256 * FStar.UInt8.v (FStar.Seq.Base.index b 3)))
) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Bytes.bytes",
"Prims.eq2",
"Prims.int",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Int32le.le_to_n_4_eq",
"Prims.unit",
"Prims._assert",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt32.v",
"LowParse.Spec.Int32le.decode_int32le",
"FStar.Endianness.le_to_n",
"FStar.Endianness.lemma_le_to_n_is_bounded",
"Prims.l_True",
"Prims.squash",
"Prims.op_Addition",
"FStar.UInt8.v",
"FStar.Seq.Base.index",
"FStar.Mul.op_Star",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let decode_int32le_eq (b: bytes{Seq.length b == 4})
: Lemma
(U32.v (decode_int32le b) ==
U8.v (Seq.index b 0) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 1) +
256
`FStar.Mul.op_Star`
(U8.v (Seq.index b 2) + 256 `FStar.Mul.op_Star` (U8.v (Seq.index b 3))))) =
| lemma_le_to_n_is_bounded b;
assert (U32.v (decode_int32le b) == le_to_n b);
le_to_n_4_eq b | false |
FStar.Pervasives.fst | FStar.Pervasives.delta_only | val delta_only (s: list string) : Tot norm_step | val delta_only (s: list string) : Tot norm_step | let delta_only s = UnfoldOnly s | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 31,
"end_line": 104,
"start_col": 0,
"start_line": 104
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list Prims.string -> FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.string",
"FStar.Pervasives.UnfoldOnly",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let delta_only s =
| UnfoldOnly s | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_eta16 | val lemma_eta16 (#a:Type) (m:map16 a) : Lemma
(ensures eta16 m == m) | val lemma_eta16 (#a:Type) (m:map16 a) : Lemma
(ensures eta16 m == m) | let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m) | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 61,
"start_col": 0,
"start_line": 42
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: Vale.Lib.Map16.map16 a -> FStar.Pervasives.Lemma (ensures Vale.Lib.Map16.eta16 m == m) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Vale.Lib.Map16.lemma_equal",
"Vale.Lib.Map16.eta16",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Vale.Lib.Map16.get"
] | [] | true | false | true | false | false | let lemma_eta16 (#a: Type) (m: map16 a) =
| let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m) | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.init_rec | val init_rec (a: Type) (f: (i: nat{i < 16} -> a)) (n: nat)
: Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) | val init_rec (a: Type) (f: (i: nat{i < 16} -> a)) (n: nat)
: Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) | let rec init_rec (a:Type) (f:(i:nat{i < 16}) -> a) (n:nat) : Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_rec a f (n - 1)) (n - 1) (f (n - 1)) | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 50,
"end_line": 85,
"start_col": 0,
"start_line": 76
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m
let equal #a m1 m2 = m1 == m2
let lemma_equal_intro #a m1 m2 =
lemma_equal m1 m2;
()
let lemma_equal_elim #a m1 m2 =
() | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> f: (i: Prims.nat{i < 16} -> a) -> n: Prims.nat -> Prims.Pure (Vale.Lib.Map16.map16 a) | Prims.Pure | [] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.Mktuple2",
"Vale.Lib.Map16.map8",
"Vale.Lib.Map16.map4",
"FStar.Pervasives.Native.tuple2",
"Vale.Lib.Map16.map2",
"Prims.bool",
"Vale.Lib.Map16.upd",
"Vale.Lib.Map16.init_rec",
"Prims.op_Subtraction",
"Vale.Lib.Map16.map16",
"Prims.op_LessThanOrEqual",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.eq2",
"Vale.Lib.Map16.sel"
] | [
"recursion"
] | false | false | false | false | false | let rec init_rec (a: Type) (f: (i: nat{i < 16} -> a)) (n: nat)
: Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) =
| if n = 0
then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else upd (init_rec a f (n - 1)) (n - 1) (f (n - 1)) | false |
FStar.Pervasives.fst | FStar.Pervasives.delta_attr | val delta_attr (s: list string) : Tot norm_step | val delta_attr (s: list string) : Tot norm_step | let delta_attr s = UnfoldAttr s | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 31,
"end_line": 110,
"start_col": 0,
"start_line": 110
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list Prims.string -> FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.string",
"FStar.Pervasives.UnfoldAttr",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let delta_attr s =
| UnfoldAttr s | false |
FStar.Pervasives.fst | FStar.Pervasives.delta_fully | val delta_fully (s: list string) : Tot norm_step | val delta_fully (s: list string) : Tot norm_step | let delta_fully s = UnfoldFully s | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 33,
"end_line": 107,
"start_col": 0,
"start_line": 107
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list Prims.string -> FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.string",
"FStar.Pervasives.UnfoldFully",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let delta_fully s =
| UnfoldFully s | false |
FStar.Pervasives.fst | FStar.Pervasives.delta_qualifier | val delta_qualifier (s: list string) : Tot norm_step | val delta_qualifier (s: list string) : Tot norm_step | let delta_qualifier s = UnfoldAttr s | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 36,
"end_line": 113,
"start_col": 0,
"start_line": 113
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list Prims.string -> FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.string",
"FStar.Pervasives.UnfoldAttr",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let delta_qualifier s =
| UnfoldAttr s | false |
FStar.Pervasives.fst | FStar.Pervasives.unmeta | val unmeta : norm_step | val unmeta : norm_step | let unmeta = Unmeta | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 19,
"end_line": 119,
"start_col": 0,
"start_line": 119
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Unmeta"
] | [] | false | false | false | true | false | let unmeta =
| Unmeta | false |
FStar.Pervasives.fst | FStar.Pervasives.norm | val norm (s: list norm_step) (#a: Type) (x: a) : Tot a | val norm (s: list norm_step) (#a: Type) (x: a) : Tot a | let norm _ #_ x = x | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 19,
"end_line": 124,
"start_col": 0,
"start_line": 124
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s
irreducible
let unmeta = Unmeta
irreducible
let unascribe = Unascribe | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list FStar.Pervasives.norm_step -> x: a -> a | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let norm _ #_ x =
| x | false |
FStar.Pervasives.fst | FStar.Pervasives.delta_namespace | val delta_namespace (s: list string) : Tot norm_step | val delta_namespace (s: list string) : Tot norm_step | let delta_namespace s = UnfoldNamespace s | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 41,
"end_line": 116,
"start_col": 0,
"start_line": 116
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | s: Prims.list Prims.string -> FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.string",
"FStar.Pervasives.UnfoldNamespace",
"FStar.Pervasives.norm_step"
] | [] | false | false | false | true | false | let delta_namespace s =
| UnfoldNamespace s | false |
FStar.Pervasives.fst | FStar.Pervasives.unascribe | val unascribe : norm_step | val unascribe : norm_step | let unascribe = Unascribe | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 25,
"end_line": 122,
"start_col": 0,
"start_line": 122
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s
irreducible
let unmeta = Unmeta | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Pervasives.norm_step | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Unascribe"
] | [] | false | false | false | true | false | let unascribe =
| Unascribe | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_eta | val lemma_eta (#a:Type) (m:map16 a) : Lemma
(ensures eta m == m)
[SMTPat (eta m)] | val lemma_eta (#a:Type) (m:map16 a) : Lemma
(ensures eta m == m)
[SMTPat (eta m)] | let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 15,
"end_line": 65,
"start_col": 0,
"start_line": 63
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: Vale.Lib.Map16.map16 a
-> FStar.Pervasives.Lemma (ensures Vale.Lib.Map16.eta m == m) [SMTPat (Vale.Lib.Map16.eta m)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Vale.Lib.Map16.lemma_eta16",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Vale.Lib.Map16.eta",
"Vale.Lib.Map16.eta16"
] | [] | true | false | true | false | false | let lemma_eta (#a: Type) (m: map16 a) =
| assert_norm (eta m == eta16 m);
lemma_eta16 m | false |
FStar.Pervasives.fst | FStar.Pervasives.inversion | val inversion (a: Type) : Type0 | val inversion (a: Type) : Type0 | let inversion _ = True | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 22,
"end_line": 134,
"start_col": 0,
"start_line": 134
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s
irreducible
let unmeta = Unmeta
irreducible
let unascribe = Unascribe
let norm _ #_ x = x
let assert_norm _ = ()
let normalize_term_spec #_ _ = ()
let normalize_spec _ = ()
let norm_spec _ #_ _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.l_True"
] | [] | false | false | false | true | true | let inversion _ =
| True | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.lemma_equal_intro | val lemma_equal_intro (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel m1 i) \/ (sel m2 i)} 0 <= i /\ i < 16 ==> sel m1 i == sel m2 i))
(ensures equal m1 m2)
[SMTPat (equal m1 m2)] | val lemma_equal_intro (#a:Type) (m1 m2:map16 a) : Lemma
(requires (forall (i:int).{:pattern (sel m1 i) \/ (sel m2 i)} 0 <= i /\ i < 16 ==> sel m1 i == sel m2 i))
(ensures equal m1 m2)
[SMTPat (equal m1 m2)] | let lemma_equal_intro #a m1 m2 =
lemma_equal m1 m2;
() | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 4,
"end_line": 71,
"start_col": 0,
"start_line": 69
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m
let equal #a m1 m2 = m1 == m2 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m1: Vale.Lib.Map16.map16 a -> m2: Vale.Lib.Map16.map16 a
-> FStar.Pervasives.Lemma
(requires
forall (i: Prims.int). {:pattern Vale.Lib.Map16.sel m1 i\/Vale.Lib.Map16.sel m2 i}
0 <= i /\ i < 16 ==> Vale.Lib.Map16.sel m1 i == Vale.Lib.Map16.sel m2 i)
(ensures Vale.Lib.Map16.equal m1 m2)
[SMTPat (Vale.Lib.Map16.equal m1 m2)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Vale.Lib.Map16.map16",
"Prims.unit",
"Vale.Lib.Map16.lemma_equal"
] | [] | true | false | true | false | false | let lemma_equal_intro #a m1 m2 =
| lemma_equal m1 m2;
() | false |
Hacl.Streaming.Keccak.fst | Hacl.Streaming.Keccak.squeeze | val squeeze:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
l:Lib.IntTypes.size_t ->
Stack error_code
(requires fun h0 ->
(is_shake a ==> B.length dst == Lib.IntTypes.v l) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
let _ = allow_inversion error_code in
match r with
| Success ->
is_shake a /\
l <> 0ul /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (c.spec_s i (reveal_key c i h0 s) (seen c i h0 s) l)) /\
preserves_freeable c i s h0 h1
| InvalidAlgorithm ->
not (is_shake a)
| InvalidLength ->
l = 0ul
| _ ->
False)) | val squeeze:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
l:Lib.IntTypes.size_t ->
Stack error_code
(requires fun h0 ->
(is_shake a ==> B.length dst == Lib.IntTypes.v l) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
let _ = allow_inversion error_code in
match r with
| Success ->
is_shake a /\
l <> 0ul /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (c.spec_s i (reveal_key c i h0 s) (seen c i h0 s) l)) /\
preserves_freeable c i s h0 h1
| InvalidAlgorithm ->
not (is_shake a)
| InvalidLength ->
l = 0ul
| _ ->
False)) | let squeeze a s dst l =
let a = get_alg a s in
if not (a = Shake128 || a = Shake256) then
InvalidAlgorithm
else if l = 0ul then
InvalidLength
else begin
digest_ a s dst l;
Success
end | {
"file_name": "code/streaming/Hacl.Streaming.Keccak.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 305,
"start_col": 0,
"start_line": 296
} | module Hacl.Streaming.Keccak
open FStar.HyperStack.ST
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
open Hacl.Streaming.Types
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
inline_for_extraction noextract
let uint64 = Lib.IntTypes.uint64
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
module D = Hacl.Hash.Definitions
module Agile = Spec.Agile.Hash
let _: squash (inversion hash_alg) = allow_inversion hash_alg
/// This is a dedicated streaming API for the Keccak construction. The reason we
/// are not piggybacking on Hacl.Streaming.MD is that we want a *single* piece
/// of code that can deal with all 6 variants at runtime, as opposed to a
/// meta-programmed version that requires six instantiations each for each one
/// of the Keccak algorithms. Notably, this means that we keep the rate at
/// run-time (relying on the key), and that we request the outputByteLen for the
/// finish function.
inline_for_extraction noextract
let alg = keccak_alg
unfold let coerce (#b #a:Type) (x:a{a == b}) : b = x
inline_for_extraction noextract
let update_multi_s (a : alg) acc (prevlen : nat) input =
Agile.update_multi a acc () input
noextract
let update_multi_zero (a : alg) acc (prevlen : nat) :
Lemma(update_multi_s a acc prevlen S.empty == acc) = Spec.Hash.Lemmas.update_multi_zero a acc
// TODO: this is the fourth copy of this lemma!! why?!
#push-options "--ifuel 1"
noextract
let update_multi_associative (a : alg) acc (prevlen1 prevlen2 : nat)
(input1 input2 : S.seq uint8) :
Lemma
(requires (
prevlen1 % U32.v (D.block_len a) = 0 /\
S.length input1 % U32.v (D.block_len a) = 0 /\
S.length input2 % U32.v (D.block_len a) = 0 /\
prevlen2 = prevlen1 + S.length input1))
(ensures (
let input = S.append input1 input2 in
S.length input % U32.v (D.block_len a) = 0 /\
prevlen2 % U32.v (D.block_len a) = 0 /\
update_multi_s a (update_multi_s a acc prevlen1 input1) prevlen2 input2 ==
update_multi_s a acc prevlen1 input)) =
Spec.Hash.Lemmas.update_multi_associative a acc input1 input2
#pop-options
inline_for_extraction noextract
let singleton #t (x: t) = y:t { y == x }
// Pretty C name
let hash_buf = hash_alg & B.buffer uint64
let hash_buf2 = hash_buf & hash_buf
inline_for_extraction noextract
let stateful_keccak: stateful alg =
Stateful
(* s: *) (fun (a: alg) ->
singleton a & b:B.buffer uint64 { B.len b == 25ul })
(* footprint: *) (fun #_ h (_, s) ->
B.loc_addr_of_buffer s)
(* freeable: *) (fun #_ h (_, s) ->
B.freeable s)
(* invariant: *) (fun #_ h (_, s) ->
B.live h s)
(* t: *) (fun _ ->
s:S.seq uint64 { S.length s == 25 })
(* v: *) (fun _ h (a, s) ->
B.as_seq h s)
(* invariant_loc_in_footprint: *) (fun #_ h (_, s) ->
())
(* frame_invariant: *) (fun #_ l (_, s) h0 h1 ->
())
(* frame_freeable: *) (fun #_ l (_, s) h0 h1 ->
())
(* alloca: *) (fun (a: alg) ->
a, B.alloca (Lib.IntTypes.u64 0) 25ul)
(* malloc: *) (fun a r ->
a, B.malloc r (Lib.IntTypes.u64 0) 25ul)
(* free: *) (fun _ (_, s) ->
B.free s)
(* copy: *) (fun _ (a, s_src) (a', s_dst) ->
B.blit s_src 0ul s_dst 0ul 25ul)
noextract inline_for_extraction
let is_shake_ a = a = Shake128 || a = Shake256
inline_for_extraction noextract
let hacl_keccak (a: G.erased alg): block alg =
Block
Erased
stateful_keccak (* state *)
(stateful_unused alg) (* key *)
Lib.IntTypes.(x:size_t { v x > 0 }) (* output_length_t *)
(fun _ ->
[@inline_let]
let max = Lib.IntTypes.(ones U64 PUB) in
assert (forall (a: alg). Hacl.Hash.Definitions.max_input_len64 a == max);
max) (* max_input_len *)
(fun a l -> if is_shake_ a then Lib.IntTypes.v l else Spec.Hash.Definitions.hash_length a) (* output_length *)
Hacl.Hash.SHA3.block_len (* block_len *)
Hacl.Hash.SHA3.block_len (* blocks_state_len *)
(fun _ -> 0ul) (* init_input_len *)
(* init_input_s *)
(fun _ _ -> S.empty)
(* init_s *)
(fun a _ -> Spec.Agile.Hash.init a)
(* update_multi_s *)
(fun a acc prevlen blocks ->
update_multi_s a acc prevlen blocks)
(* update_last_s *)
(fun a acc prevlen input -> Spec.Hash.Incremental.(update_last a acc () input))
(* finish_s *)
(fun a _ acc l -> Spec.Agile.Hash.finish a acc (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(fun a _ s l -> Spec.Agile.Hash.(hash' a s (if is_shake_ a then (Lib.IntTypes.v l) else ())))
(* update_multi_zero *)
(fun a h prevlen -> update_multi_zero a h prevlen)
(* update_multi_associative *)
(fun a acc prevlen1 prevlen2 input1 input2 ->
update_multi_associative a acc prevlen1 prevlen2 input1 input2)
(* spec_is_incremental *)
(fun a _ input l ->
let input1 = S.append S.empty input in
assert (S.equal input1 input);
Spec.Hash.Incremental.hash_is_hash_incremental' a input (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(* index_of_state *)
(fun _ (a, _) -> a)
(* init *)
(fun _ _ _ (a, s) -> Hacl.Hash.SHA3.init a s)
(* update_multi *)
(fun _ (a, s) _ blocks len ->
Hacl.Hash.SHA3.update_multi a s () blocks (len `U32.div` Hacl.Hash.SHA3.(block_len a)))
(* update_last *)
(fun _ (a, s) _ last last_len ->
Hacl.Hash.SHA3.update_last a s () last last_len)
(* finish *)
(fun _ _ (a, s) dst l ->
Hacl.Hash.SHA3.(finish_keccak a s dst l))
// For pretty names in C
let state_t = F.state_s' (hacl_keccak SHA3_256) SHA3_256
let sha3_state a = singleton a & b:B.buffer uint64 { B.len b == 25ul }
let get_alg (a: G.erased alg) =
F.index_of_state (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let malloc (a: alg) =
F.malloc (hacl_keccak a) a (sha3_state a) (G.erased unit)
let free (a: G.erased alg) =
F.free (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let copy (a: G.erased alg) =
F.copy (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let reset (a: G.erased alg) =
F.reset (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let update (a: G.erased alg) =
F.update (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
private
let digest_ (a: alg) =
F.digest #alg (hacl_keccak a) a (sha3_state a) (G.erased unit)
open Hacl.Streaming.Functor
// Unfortunate copy-paste since there are small variations (error code, output length)
val digest:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
Stack error_code
(requires fun h0 ->
(not (is_shake a) ==> B.length dst == Spec.Hash.Definitions.hash_length a) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
match r with
| Success ->
not (is_shake a) /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (Spec.Agile.Hash.hash a (seen c i h0 s)) /\
preserves_freeable c i s h0 h1)
| InvalidAlgorithm ->
is_shake a
| _ ->
False))
let digest a state output =
let a = get_alg a state in
if (a = Shake128 || a = Shake256) then
InvalidAlgorithm
else begin
digest_ a state output (Hacl.Hash.SHA3.hash_len a);
Success
end
// Unfortunate copy-paste since we are returning an error code
val squeeze:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
l:Lib.IntTypes.size_t ->
Stack error_code
(requires fun h0 ->
(is_shake a ==> B.length dst == Lib.IntTypes.v l) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
let _ = allow_inversion error_code in
match r with
| Success ->
is_shake a /\
l <> 0ul /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (c.spec_s i (reveal_key c i h0 s) (seen c i h0 s) l)) /\
preserves_freeable c i s h0 h1
| InvalidAlgorithm ->
not (is_shake a)
| InvalidLength ->
l = 0ul
| _ ->
False)) | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fsti.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Streaming.Types.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.SHA3.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Keccak.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.Functor",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "Agile"
},
{
"abbrev": true,
"full_module": "Hacl.Hash.Definitions",
"short_module": "D"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Ghost.erased Hacl.Streaming.Keccak.alg
-> (let c = Hacl.Streaming.Keccak.hacl_keccak a in
let a = FStar.Ghost.reveal a in
let i = a in
let t = Hacl.Streaming.Keccak.sha3_state a in
let t' = FStar.Ghost.erased Prims.unit in
s: Hacl.Streaming.Functor.state c i t t' ->
dst: LowStar.Buffer.buffer Hacl.Streaming.Functor.uint8 ->
l: Lib.IntTypes.size_t
-> FStar.HyperStack.ST.Stack Hacl.Streaming.Types.error_code) | Prims.Tot | [
"total"
] | [] | [
"FStar.Ghost.erased",
"Hacl.Streaming.Keccak.alg",
"Hacl.Streaming.Functor.state",
"Hacl.Streaming.Keccak.hacl_keccak",
"FStar.Ghost.reveal",
"Hacl.Streaming.Keccak.sha3_state",
"Prims.unit",
"LowStar.Buffer.buffer",
"Hacl.Streaming.Functor.uint8",
"Lib.IntTypes.size_t",
"Prims.op_Negation",
"Prims.op_BarBar",
"Prims.op_Equality",
"Spec.Hash.Definitions.hash_alg",
"Spec.Hash.Definitions.Shake128",
"Spec.Hash.Definitions.Shake256",
"Hacl.Streaming.Types.InvalidAlgorithm",
"Hacl.Streaming.Types.error_code",
"Prims.bool",
"FStar.UInt32.t",
"FStar.UInt32.__uint_to_t",
"Hacl.Streaming.Types.InvalidLength",
"Hacl.Streaming.Types.Success",
"Hacl.Streaming.Keccak.digest_",
"Hacl.Streaming.Keccak.get_alg"
] | [] | false | false | false | false | false | let squeeze a s dst l =
| let a = get_alg a s in
if not (a = Shake128 || a = Shake256)
then InvalidAlgorithm
else
if l = 0ul
then InvalidLength
else
(digest_ a s dst l;
Success) | false |
Hacl.Streaming.Keccak.fst | Hacl.Streaming.Keccak.digest | val digest:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
Stack error_code
(requires fun h0 ->
(not (is_shake a) ==> B.length dst == Spec.Hash.Definitions.hash_length a) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
match r with
| Success ->
not (is_shake a) /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (Spec.Agile.Hash.hash a (seen c i h0 s)) /\
preserves_freeable c i s h0 h1)
| InvalidAlgorithm ->
is_shake a
| _ ->
False)) | val digest:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
Stack error_code
(requires fun h0 ->
(not (is_shake a) ==> B.length dst == Spec.Hash.Definitions.hash_length a) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
match r with
| Success ->
not (is_shake a) /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (Spec.Agile.Hash.hash a (seen c i h0 s)) /\
preserves_freeable c i s h0 h1)
| InvalidAlgorithm ->
is_shake a
| _ ->
False)) | let digest a state output =
let a = get_alg a state in
if (a = Shake128 || a = Shake256) then
InvalidAlgorithm
else begin
digest_ a state output (Hacl.Hash.SHA3.hash_len a);
Success
end | {
"file_name": "code/streaming/Hacl.Streaming.Keccak.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 5,
"end_line": 256,
"start_col": 0,
"start_line": 249
} | module Hacl.Streaming.Keccak
open FStar.HyperStack.ST
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
open Hacl.Streaming.Types
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
inline_for_extraction noextract
let uint64 = Lib.IntTypes.uint64
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
module D = Hacl.Hash.Definitions
module Agile = Spec.Agile.Hash
let _: squash (inversion hash_alg) = allow_inversion hash_alg
/// This is a dedicated streaming API for the Keccak construction. The reason we
/// are not piggybacking on Hacl.Streaming.MD is that we want a *single* piece
/// of code that can deal with all 6 variants at runtime, as opposed to a
/// meta-programmed version that requires six instantiations each for each one
/// of the Keccak algorithms. Notably, this means that we keep the rate at
/// run-time (relying on the key), and that we request the outputByteLen for the
/// finish function.
inline_for_extraction noextract
let alg = keccak_alg
unfold let coerce (#b #a:Type) (x:a{a == b}) : b = x
inline_for_extraction noextract
let update_multi_s (a : alg) acc (prevlen : nat) input =
Agile.update_multi a acc () input
noextract
let update_multi_zero (a : alg) acc (prevlen : nat) :
Lemma(update_multi_s a acc prevlen S.empty == acc) = Spec.Hash.Lemmas.update_multi_zero a acc
// TODO: this is the fourth copy of this lemma!! why?!
#push-options "--ifuel 1"
noextract
let update_multi_associative (a : alg) acc (prevlen1 prevlen2 : nat)
(input1 input2 : S.seq uint8) :
Lemma
(requires (
prevlen1 % U32.v (D.block_len a) = 0 /\
S.length input1 % U32.v (D.block_len a) = 0 /\
S.length input2 % U32.v (D.block_len a) = 0 /\
prevlen2 = prevlen1 + S.length input1))
(ensures (
let input = S.append input1 input2 in
S.length input % U32.v (D.block_len a) = 0 /\
prevlen2 % U32.v (D.block_len a) = 0 /\
update_multi_s a (update_multi_s a acc prevlen1 input1) prevlen2 input2 ==
update_multi_s a acc prevlen1 input)) =
Spec.Hash.Lemmas.update_multi_associative a acc input1 input2
#pop-options
inline_for_extraction noextract
let singleton #t (x: t) = y:t { y == x }
// Pretty C name
let hash_buf = hash_alg & B.buffer uint64
let hash_buf2 = hash_buf & hash_buf
inline_for_extraction noextract
let stateful_keccak: stateful alg =
Stateful
(* s: *) (fun (a: alg) ->
singleton a & b:B.buffer uint64 { B.len b == 25ul })
(* footprint: *) (fun #_ h (_, s) ->
B.loc_addr_of_buffer s)
(* freeable: *) (fun #_ h (_, s) ->
B.freeable s)
(* invariant: *) (fun #_ h (_, s) ->
B.live h s)
(* t: *) (fun _ ->
s:S.seq uint64 { S.length s == 25 })
(* v: *) (fun _ h (a, s) ->
B.as_seq h s)
(* invariant_loc_in_footprint: *) (fun #_ h (_, s) ->
())
(* frame_invariant: *) (fun #_ l (_, s) h0 h1 ->
())
(* frame_freeable: *) (fun #_ l (_, s) h0 h1 ->
())
(* alloca: *) (fun (a: alg) ->
a, B.alloca (Lib.IntTypes.u64 0) 25ul)
(* malloc: *) (fun a r ->
a, B.malloc r (Lib.IntTypes.u64 0) 25ul)
(* free: *) (fun _ (_, s) ->
B.free s)
(* copy: *) (fun _ (a, s_src) (a', s_dst) ->
B.blit s_src 0ul s_dst 0ul 25ul)
noextract inline_for_extraction
let is_shake_ a = a = Shake128 || a = Shake256
inline_for_extraction noextract
let hacl_keccak (a: G.erased alg): block alg =
Block
Erased
stateful_keccak (* state *)
(stateful_unused alg) (* key *)
Lib.IntTypes.(x:size_t { v x > 0 }) (* output_length_t *)
(fun _ ->
[@inline_let]
let max = Lib.IntTypes.(ones U64 PUB) in
assert (forall (a: alg). Hacl.Hash.Definitions.max_input_len64 a == max);
max) (* max_input_len *)
(fun a l -> if is_shake_ a then Lib.IntTypes.v l else Spec.Hash.Definitions.hash_length a) (* output_length *)
Hacl.Hash.SHA3.block_len (* block_len *)
Hacl.Hash.SHA3.block_len (* blocks_state_len *)
(fun _ -> 0ul) (* init_input_len *)
(* init_input_s *)
(fun _ _ -> S.empty)
(* init_s *)
(fun a _ -> Spec.Agile.Hash.init a)
(* update_multi_s *)
(fun a acc prevlen blocks ->
update_multi_s a acc prevlen blocks)
(* update_last_s *)
(fun a acc prevlen input -> Spec.Hash.Incremental.(update_last a acc () input))
(* finish_s *)
(fun a _ acc l -> Spec.Agile.Hash.finish a acc (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(fun a _ s l -> Spec.Agile.Hash.(hash' a s (if is_shake_ a then (Lib.IntTypes.v l) else ())))
(* update_multi_zero *)
(fun a h prevlen -> update_multi_zero a h prevlen)
(* update_multi_associative *)
(fun a acc prevlen1 prevlen2 input1 input2 ->
update_multi_associative a acc prevlen1 prevlen2 input1 input2)
(* spec_is_incremental *)
(fun a _ input l ->
let input1 = S.append S.empty input in
assert (S.equal input1 input);
Spec.Hash.Incremental.hash_is_hash_incremental' a input (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(* index_of_state *)
(fun _ (a, _) -> a)
(* init *)
(fun _ _ _ (a, s) -> Hacl.Hash.SHA3.init a s)
(* update_multi *)
(fun _ (a, s) _ blocks len ->
Hacl.Hash.SHA3.update_multi a s () blocks (len `U32.div` Hacl.Hash.SHA3.(block_len a)))
(* update_last *)
(fun _ (a, s) _ last last_len ->
Hacl.Hash.SHA3.update_last a s () last last_len)
(* finish *)
(fun _ _ (a, s) dst l ->
Hacl.Hash.SHA3.(finish_keccak a s dst l))
// For pretty names in C
let state_t = F.state_s' (hacl_keccak SHA3_256) SHA3_256
let sha3_state a = singleton a & b:B.buffer uint64 { B.len b == 25ul }
let get_alg (a: G.erased alg) =
F.index_of_state (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let malloc (a: alg) =
F.malloc (hacl_keccak a) a (sha3_state a) (G.erased unit)
let free (a: G.erased alg) =
F.free (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let copy (a: G.erased alg) =
F.copy (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let reset (a: G.erased alg) =
F.reset (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
let update (a: G.erased alg) =
F.update (hacl_keccak a) a (sha3_state (G.reveal a)) (G.erased unit)
private
let digest_ (a: alg) =
F.digest #alg (hacl_keccak a) a (sha3_state a) (G.erased unit)
open Hacl.Streaming.Functor
// Unfortunate copy-paste since there are small variations (error code, output length)
val digest:
a:G.erased alg -> (
let c = hacl_keccak a in
let a = G.reveal a in
let i = a in
let t = sha3_state a in
let t' = G.erased unit in
s:state c i t t' ->
dst:B.buffer uint8 ->
Stack error_code
(requires fun h0 ->
(not (is_shake a) ==> B.length dst == Spec.Hash.Definitions.hash_length a) /\
invariant c i h0 s /\
B.live h0 dst /\
B.(loc_disjoint (loc_buffer dst) (footprint c i h0 s)))
(ensures fun h0 r h1 ->
match r with
| Success ->
not (is_shake a) /\
invariant c i h1 s /\
seen c i h0 s == seen c i h1 s /\
reveal_key c i h1 s == reveal_key c i h0 s /\
footprint c i h0 s == footprint c i h1 s /\
B.(modifies (loc_union (loc_buffer dst) (footprint c i h0 s)) h0 h1) /\ (
seen_bounded c i h0 s;
S.equal (B.as_seq h1 dst) (Spec.Agile.Hash.hash a (seen c i h0 s)) /\
preserves_freeable c i s h0 h1)
| InvalidAlgorithm ->
is_shake a
| _ ->
False)) | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fsti.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Streaming.Types.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.SHA3.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Keccak.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.Functor",
"short_module": null
},
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "Agile"
},
{
"abbrev": true,
"full_module": "Hacl.Hash.Definitions",
"short_module": "D"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Ghost.erased Hacl.Streaming.Keccak.alg
-> (let c = Hacl.Streaming.Keccak.hacl_keccak a in
let a = FStar.Ghost.reveal a in
let i = a in
let t = Hacl.Streaming.Keccak.sha3_state a in
let t' = FStar.Ghost.erased Prims.unit in
s: Hacl.Streaming.Functor.state c i t t' ->
dst: LowStar.Buffer.buffer Hacl.Streaming.Functor.uint8
-> FStar.HyperStack.ST.Stack Hacl.Streaming.Types.error_code) | Prims.Tot | [
"total"
] | [] | [
"FStar.Ghost.erased",
"Hacl.Streaming.Keccak.alg",
"Hacl.Streaming.Functor.state",
"Hacl.Streaming.Keccak.hacl_keccak",
"FStar.Ghost.reveal",
"Hacl.Streaming.Keccak.sha3_state",
"Prims.unit",
"LowStar.Buffer.buffer",
"Hacl.Streaming.Functor.uint8",
"Prims.op_BarBar",
"Prims.op_Equality",
"Spec.Hash.Definitions.hash_alg",
"Spec.Hash.Definitions.Shake128",
"Spec.Hash.Definitions.Shake256",
"Hacl.Streaming.Types.InvalidAlgorithm",
"Hacl.Streaming.Types.error_code",
"Prims.bool",
"Hacl.Streaming.Types.Success",
"Hacl.Streaming.Keccak.digest_",
"Hacl.Hash.SHA3.hash_len",
"Hacl.Streaming.Keccak.get_alg"
] | [] | false | false | false | false | false | let digest a state output =
| let a = get_alg a state in
if (a = Shake128 || a = Shake256)
then InvalidAlgorithm
else
(digest_ a state output (Hacl.Hash.SHA3.hash_len a);
Success) | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.init | val init (a:Type) (f:(i:nat{i < 16}) -> a) : Pure (map16 a)
(requires True)
(ensures fun m -> forall (i:int).{:pattern (sel m i)} 0 <= i /\ i < 16 ==> sel m i == f i) | val init (a:Type) (f:(i:nat{i < 16}) -> a) : Pure (map16 a)
(requires True)
(ensures fun m -> forall (i:int).{:pattern (sel m i)} 0 <= i /\ i < 16 ==> sel m i == f i) | let init a f =
init_rec a f 16 | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 17,
"end_line": 88,
"start_col": 0,
"start_line": 87
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m
let equal #a m1 m2 = m1 == m2
let lemma_equal_intro #a m1 m2 =
lemma_equal m1 m2;
()
let lemma_equal_elim #a m1 m2 =
()
let rec init_rec (a:Type) (f:(i:nat{i < 16}) -> a) (n:nat) : Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_rec a f (n - 1)) (n - 1) (f (n - 1)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> f: (i: Prims.nat{i < 16} -> a) -> Prims.Pure (Vale.Lib.Map16.map16 a) | Prims.Pure | [] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.Lib.Map16.init_rec",
"Vale.Lib.Map16.map16"
] | [] | false | false | false | false | false | let init a f =
| init_rec a f 16 | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.init_ghost | val init_ghost (a:Type) (f:(i:nat{i < 16}) -> GTot a) : Ghost (map16 a)
(requires True)
(ensures fun m -> forall (i:int).{:pattern (sel m i)} 0 <= i /\ i < 16 ==> sel m i == f i) | val init_ghost (a:Type) (f:(i:nat{i < 16}) -> GTot a) : Ghost (map16 a)
(requires True)
(ensures fun m -> forall (i:int).{:pattern (sel m i)} 0 <= i /\ i < 16 ==> sel m i == f i) | let init_ghost a f =
init_ghost_rec a f 16 | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 23,
"end_line": 102,
"start_col": 0,
"start_line": 101
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m
let equal #a m1 m2 = m1 == m2
let lemma_equal_intro #a m1 m2 =
lemma_equal m1 m2;
()
let lemma_equal_elim #a m1 m2 =
()
let rec init_rec (a:Type) (f:(i:nat{i < 16}) -> a) (n:nat) : Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_rec a f (n - 1)) (n - 1) (f (n - 1))
let init a f =
init_rec a f 16
let rec init_ghost_rec (a:Type) (f:(i:nat{i < 16}) -> GTot a) (n:nat) : Ghost (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_ghost_rec a f (n - 1)) (n - 1) (f (n - 1)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> f: (i: Prims.nat{i < 16} -> Prims.GTot a) -> Prims.Ghost (Vale.Lib.Map16.map16 a) | Prims.Ghost | [] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.Lib.Map16.init_ghost_rec",
"Vale.Lib.Map16.map16"
] | [] | false | false | false | false | false | let init_ghost a f =
| init_ghost_rec a f 16 | false |
Hacl.Impl.P256.Bignum.fsti | Hacl.Impl.P256.Bignum.wide_as_nat | val wide_as_nat (h: mem) (e: widefelem) : GTot nat | val wide_as_nat (h: mem) (e: widefelem) : GTot nat | let wide_as_nat (h:mem) (e:widefelem) : GTot nat =
BD.bn_v (as_seq h e) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Bignum.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 28,
"start_col": 0,
"start_line": 27
} | module Hacl.Impl.P256.Bignum
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module BD = Hacl.Spec.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction
let felem = lbuffer uint64 (size 4)
inline_for_extraction
let widefelem = lbuffer uint64 (size 8)
unfold
let as_nat (h:mem) (e:felem) : GTot nat =
BD.bn_v (as_seq h e) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.P256.Bignum.fsti"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.HyperStack.mem -> e: Hacl.Impl.P256.Bignum.widefelem -> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.P256.Bignum.widefelem",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.size",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint64",
"Prims.nat"
] | [] | false | false | false | false | false | let wide_as_nat (h: mem) (e: widefelem) : GTot nat =
| BD.bn_v (as_seq h e) | false |
Vale.Lib.Map16.fst | Vale.Lib.Map16.init_ghost_rec | val init_ghost_rec (a: Type) (f: (i: nat{i < 16} -> GTot a)) (n: nat)
: Ghost (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) | val init_ghost_rec (a: Type) (f: (i: nat{i < 16} -> GTot a)) (n: nat)
: Ghost (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) | let rec init_ghost_rec (a:Type) (f:(i:nat{i < 16}) -> GTot a) (n:nat) : Ghost (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_ghost_rec a f (n - 1)) (n - 1) (f (n - 1)) | {
"file_name": "vale/code/lib/collections/Vale.Lib.Map16.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 56,
"end_line": 99,
"start_col": 0,
"start_line": 90
} | module Vale.Lib.Map16
open FStar.Mul
let lemma_self16 (#a:Type) (m:map16 a) (n:int) (v:a) = ()
let lemma_other16 (#a:Type) (m:map16 a) (n1 n2:int) (v:a) = ()
#reset-options "--initial_ifuel 5 --max_ifuel 5"
let lemma_equal16 (#a:Type) (m1 m2:map16 a) =
assert (sel16 m1 0 == sel16 m2 0);
assert (sel16 m1 1 == sel16 m2 1);
assert (sel16 m1 2 == sel16 m2 2);
assert (sel16 m1 3 == sel16 m2 3);
assert (sel16 m1 4 == sel16 m2 4);
assert (sel16 m1 5 == sel16 m2 5);
assert (sel16 m1 6 == sel16 m2 6);
assert (sel16 m1 7 == sel16 m2 7);
assert (sel16 m1 8 == sel16 m2 8);
assert (sel16 m1 9 == sel16 m2 9);
assert (sel16 m1 10 == sel16 m2 10);
assert (sel16 m1 11 == sel16 m2 11);
assert (sel16 m1 12 == sel16 m2 12);
assert (sel16 m1 13 == sel16 m2 13);
assert (sel16 m1 14 == sel16 m2 14);
assert (sel16 m1 15 == sel16 m2 15);
()
#reset-options
let lemma_self (#a:Type) (m:map16 a) (n:int) (v:a) =
assert_norm (sel (upd m n v) n == sel16 (upd16 m n v) n);
lemma_self16 m n v
let lemma_other (#a:Type) (m:map16 a) (n1 n2:int) (v:a) =
assert_norm (sel (upd m n1 v) n2 == sel16 (upd16 m n1 v) n2);
assert_norm (sel m n2 == sel16 m n2);
lemma_other16 m n1 n2 v
let lemma_equal (#a:Type) (m1 m2:map16 a) =
assert_norm (forall (i:int). sel m1 i == sel16 m1 i);
assert_norm (forall (i:int). sel m2 i == sel16 m2 i);
lemma_equal16 m1 m2
let lemma_eta16 (#a:Type) (m:map16 a) =
let m1 = m in
let m2 = eta16 m in
assert_norm (get m1 0 == get m2 0);
assert_norm (get m1 1 == get m2 1);
assert_norm (get m1 2 == get m2 2);
assert_norm (get m1 3 == get m2 3);
assert_norm (get m1 4 == get m2 4);
assert_norm (get m1 5 == get m2 5);
assert_norm (get m1 6 == get m2 6);
assert_norm (get m1 7 == get m2 7);
assert_norm (get m1 8 == get m2 8);
assert_norm (get m1 9 == get m2 9);
assert_norm (get m1 10 == get m2 10);
assert_norm (get m1 11 == get m2 11);
assert_norm (get m1 12 == get m2 12);
assert_norm (get m1 13 == get m2 13);
assert_norm (get m1 14 == get m2 14);
assert_norm (get m1 15 == get m2 15);
lemma_equal m (eta16 m)
let lemma_eta (#a:Type) (m:map16 a) =
assert_norm (eta m == eta16 m);
lemma_eta16 m
let equal #a m1 m2 = m1 == m2
let lemma_equal_intro #a m1 m2 =
lemma_equal m1 m2;
()
let lemma_equal_elim #a m1 m2 =
()
let rec init_rec (a:Type) (f:(i:nat{i < 16}) -> a) (n:nat) : Pure (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i:nat).{:pattern sel m i} i < n ==> sel m i == f i)
=
if n = 0 then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else
upd (init_rec a f (n - 1)) (n - 1) (f (n - 1))
let init a f =
init_rec a f 16 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Vale.Lib.Map16.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: Type -> f: (i: Prims.nat{i < 16} -> Prims.GTot a) -> n: Prims.nat
-> Prims.Ghost (Vale.Lib.Map16.map16 a) | Prims.Ghost | [] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.Mktuple2",
"Vale.Lib.Map16.map8",
"Vale.Lib.Map16.map4",
"FStar.Pervasives.Native.tuple2",
"Vale.Lib.Map16.map2",
"Prims.bool",
"Vale.Lib.Map16.upd",
"Vale.Lib.Map16.init_ghost_rec",
"Prims.op_Subtraction",
"Vale.Lib.Map16.map16",
"Prims.op_LessThanOrEqual",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.eq2",
"Vale.Lib.Map16.sel"
] | [
"recursion"
] | false | false | false | false | false | let rec init_ghost_rec (a: Type) (f: (i: nat{i < 16} -> GTot a)) (n: nat)
: Ghost (map16 a)
(requires n <= 16)
(ensures fun m -> forall (i: nat). {:pattern sel m i} i < n ==> sel m i == f i) =
| if n = 0
then
let m1 = f 0 in
let m4 = ((m1, m1), (m1, m1)) in
((m4, m4), (m4, m4))
else upd (init_ghost_rec a f (n - 1)) (n - 1) (f (n - 1)) | false |
Hacl.Impl.P256.Bignum.fsti | Hacl.Impl.P256.Bignum.widefelem | val widefelem : Type0 | let widefelem = lbuffer uint64 (size 8) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Bignum.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 39,
"end_line": 20,
"start_col": 0,
"start_line": 20
} | module Hacl.Impl.P256.Bignum
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module BD = Hacl.Spec.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction
let felem = lbuffer uint64 (size 4) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.P256.Bignum.fsti"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint64",
"Lib.IntTypes.size"
] | [] | false | false | false | true | true | let widefelem =
| lbuffer uint64 (size 8) | false |
|
FStar.Pervasives.fst | FStar.Pervasives.false_elim | val false_elim (#a: Type) (u: unit{False}) : Tot a | val false_elim (#a: Type) (u: unit{False}) : Tot a | let rec false_elim #_ _ = false_elim () | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 140,
"start_col": 0,
"start_line": 140
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s
irreducible
let unmeta = Unmeta
irreducible
let unascribe = Unascribe
let norm _ #_ x = x
let assert_norm _ = ()
let normalize_term_spec #_ _ = ()
let normalize_spec _ = ()
let norm_spec _ #_ _ = ()
let inversion _ = True
let allow_inversion _ = ()
let invertOption _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | u930: u931: Prims.unit{Prims.l_False} -> a | Prims.Tot | [
"total"
] | [] | [
"Prims.unit",
"Prims.l_False",
"FStar.Pervasives.false_elim"
] | [
"recursion"
] | false | false | false | false | false | let rec false_elim #_ _ =
| false_elim () | false |
Hacl.Impl.P256.Bignum.fsti | Hacl.Impl.P256.Bignum.as_nat | val as_nat (h: mem) (e: felem) : GTot nat | val as_nat (h: mem) (e: felem) : GTot nat | let as_nat (h:mem) (e:felem) : GTot nat =
BD.bn_v (as_seq h e) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Bignum.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 24,
"start_col": 0,
"start_line": 23
} | module Hacl.Impl.P256.Bignum
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module BD = Hacl.Spec.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction
let felem = lbuffer uint64 (size 4)
inline_for_extraction
let widefelem = lbuffer uint64 (size 8) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.P256.Bignum.fsti"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: FStar.Monotonic.HyperStack.mem -> e: Hacl.Impl.P256.Bignum.felem -> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"Hacl.Impl.P256.Bignum.felem",
"Hacl.Spec.Bignum.Definitions.bn_v",
"Lib.IntTypes.U64",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.size",
"Lib.Buffer.as_seq",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint64",
"Prims.nat"
] | [] | false | false | false | false | false | let as_nat (h: mem) (e: felem) : GTot nat =
| BD.bn_v (as_seq h e) | false |
FStar.Pervasives.fst | FStar.Pervasives.singleton | val singleton (#a: Type) (x: a) : Tot (y: a{y == x}) | val singleton (#a: Type) (x: a) : Tot (y: a{y == x}) | let singleton #_ x = x | {
"file_name": "ulib/FStar.Pervasives.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 22,
"end_line": 200,
"start_col": 0,
"start_line": 200
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Pervasives
(* This is a file from the core library, dependencies must be explicit *)
open Prims
/// Implementation of FStar.Pervasives.fsti
let remove_unused_type_parameters _ = ()
let smt_pat #_ _ = ()
let smt_pat_or _ = ()
let spinoff p = p
#push-options "--no_tactics"
let spinoff_eq _ = ()
let spinoff_equiv _ = ()
#pop-options
let assert_spinoff _ = ()
let ambient #_ _ = True
let intro_ambient #_ _ = ()
let normalize_term #_ x = x
let normalize a = a
noeq
type norm_step =
| Simpl // Logical simplification, e.g., [P /\ True ~> P]
| Weak // Weak reduction: Do not reduce under binders
| HNF // Head normal form
| Primops // Reduce primitive operators, e.g., [1 + 1 ~> 2]
| Delta // Unfold all non-recursive definitions
| Zeta // Unroll recursive calls
| ZetaFull // Unroll recursive calls fully
| Iota // Reduce case analysis (i.e., match)
| NBE // Use normalization-by-evaluation, instead of interpretation (experimental)
| Reify // Reify effectful definitions into their representations
| NormDebug // Turn on debugging for this call
| UnfoldOnly : list string -> norm_step // Unlike Delta, unfold definitions for only the given
// names, each string is a fully qualified name
// like `A.M.f`
// idem
| UnfoldFully : list string -> norm_step
| UnfoldAttr : list string -> norm_step // Unfold definitions marked with the given attributes
| UnfoldQual : list string -> norm_step
| UnfoldNamespace : list string -> norm_step
| Unmeta : norm_step
| Unascribe // Remove type ascriptions [t <: ty ~> t]
irreducible
let simplify = Simpl
irreducible
let weak = Weak
irreducible
let hnf = HNF
irreducible
let primops = Primops
irreducible
let delta = Delta
irreducible
let norm_debug = NormDebug
irreducible
let zeta = Zeta
irreducible
let zeta_full = ZetaFull
irreducible
let iota = Iota
irreducible
let nbe = NBE
irreducible
let reify_ = Reify
irreducible
let delta_only s = UnfoldOnly s
irreducible
let delta_fully s = UnfoldFully s
irreducible
let delta_attr s = UnfoldAttr s
irreducible
let delta_qualifier s = UnfoldAttr s
irreducible
let delta_namespace s = UnfoldNamespace s
irreducible
let unmeta = Unmeta
irreducible
let unascribe = Unascribe
let norm _ #_ x = x
let assert_norm _ = ()
let normalize_term_spec #_ _ = ()
let normalize_spec _ = ()
let norm_spec _ #_ _ = ()
let inversion _ = True
let allow_inversion _ = ()
let invertOption _ = ()
let rec false_elim #_ _ = false_elim ()
let inline_let = ()
let rename_let _ = ()
let plugin _ = ()
let tcnorm = ()
let must_erase_for_extraction = ()
let dm4f_bind_range = ()
let expect_failure _ = ()
let expect_lax_failure _ = ()
let tcdecltime = ()
let unifier_hint_injective = ()
let strict_on_arguments _ = ()
let resolve_implicits = ()
let override_resolve_implicits_handler #a x l = ()
let handle_smt_goals = ()
let erasable = ()
let commute_nested_matches = ()
let noextract_to _ = ()
let normalize_for_extraction _ = ()
let ite_soundness_by _ = ()
let default_effect _ = ()
let top_level_effect _ = ()
let effect_param = ()
let bind_has_range_args = ()
let primitive_extraction = ()
let extract_as_impure_effect = ()
let strictly_positive = ()
let unused = ()
let no_auto_projectors = ()
let no_auto_projectors_decls = ()
let no_subtyping = ()
let admit_termination = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Pervasives.fst"
} | [
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives.Native",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: a -> y: a{y == x} | Prims.Tot | [
"total"
] | [] | [
"Prims.eq2"
] | [] | false | false | false | false | false | let singleton #_ x =
| x | false |
Hacl.Impl.P256.Bignum.fsti | Hacl.Impl.P256.Bignum.felem | val felem : Type0 | let felem = lbuffer uint64 (size 4) | {
"file_name": "code/ecdsap256/Hacl.Impl.P256.Bignum.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 18,
"start_col": 0,
"start_line": 18
} | module Hacl.Impl.P256.Bignum
open FStar.Mul
open FStar.HyperStack.All
open FStar.HyperStack
module ST = FStar.HyperStack.ST
open Lib.IntTypes
open Lib.Buffer
module LSeq = Lib.Sequence
module BSeq = Lib.ByteSequence
module BD = Hacl.Spec.Bignum.Definitions
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.P256.Bignum.fsti"
} | [
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": "BD"
},
{
"abbrev": true,
"full_module": "Lib.ByteSequence",
"short_module": "BSeq"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.P256",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint64",
"Lib.IntTypes.size"
] | [] | false | false | false | true | true | let felem =
| lbuffer uint64 (size 4) | false |
|
Hacl.Streaming.Keccak.fst | Hacl.Streaming.Keccak.hacl_keccak | val hacl_keccak (a: G.erased alg) : block alg | val hacl_keccak (a: G.erased alg) : block alg | let hacl_keccak (a: G.erased alg): block alg =
Block
Erased
stateful_keccak (* state *)
(stateful_unused alg) (* key *)
Lib.IntTypes.(x:size_t { v x > 0 }) (* output_length_t *)
(fun _ ->
[@inline_let]
let max = Lib.IntTypes.(ones U64 PUB) in
assert (forall (a: alg). Hacl.Hash.Definitions.max_input_len64 a == max);
max) (* max_input_len *)
(fun a l -> if is_shake_ a then Lib.IntTypes.v l else Spec.Hash.Definitions.hash_length a) (* output_length *)
Hacl.Hash.SHA3.block_len (* block_len *)
Hacl.Hash.SHA3.block_len (* blocks_state_len *)
(fun _ -> 0ul) (* init_input_len *)
(* init_input_s *)
(fun _ _ -> S.empty)
(* init_s *)
(fun a _ -> Spec.Agile.Hash.init a)
(* update_multi_s *)
(fun a acc prevlen blocks ->
update_multi_s a acc prevlen blocks)
(* update_last_s *)
(fun a acc prevlen input -> Spec.Hash.Incremental.(update_last a acc () input))
(* finish_s *)
(fun a _ acc l -> Spec.Agile.Hash.finish a acc (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(fun a _ s l -> Spec.Agile.Hash.(hash' a s (if is_shake_ a then (Lib.IntTypes.v l) else ())))
(* update_multi_zero *)
(fun a h prevlen -> update_multi_zero a h prevlen)
(* update_multi_associative *)
(fun a acc prevlen1 prevlen2 input1 input2 ->
update_multi_associative a acc prevlen1 prevlen2 input1 input2)
(* spec_is_incremental *)
(fun a _ input l ->
let input1 = S.append S.empty input in
assert (S.equal input1 input);
Spec.Hash.Incremental.hash_is_hash_incremental' a input (if is_shake_ a then (Lib.IntTypes.v l) else ()))
(* index_of_state *)
(fun _ (a, _) -> a)
(* init *)
(fun _ _ _ (a, s) -> Hacl.Hash.SHA3.init a s)
(* update_multi *)
(fun _ (a, s) _ blocks len ->
Hacl.Hash.SHA3.update_multi a s () blocks (len `U32.div` Hacl.Hash.SHA3.(block_len a)))
(* update_last *)
(fun _ (a, s) _ last last_len ->
Hacl.Hash.SHA3.update_last a s () last last_len)
(* finish *)
(fun _ _ (a, s) dst l ->
Hacl.Hash.SHA3.(finish_keccak a s dst l)) | {
"file_name": "code/streaming/Hacl.Streaming.Keccak.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 185,
"start_col": 0,
"start_line": 121
} | module Hacl.Streaming.Keccak
open FStar.HyperStack.ST
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
open Hacl.Streaming.Types
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
inline_for_extraction noextract
let uint64 = Lib.IntTypes.uint64
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
module D = Hacl.Hash.Definitions
module Agile = Spec.Agile.Hash
let _: squash (inversion hash_alg) = allow_inversion hash_alg
/// This is a dedicated streaming API for the Keccak construction. The reason we
/// are not piggybacking on Hacl.Streaming.MD is that we want a *single* piece
/// of code that can deal with all 6 variants at runtime, as opposed to a
/// meta-programmed version that requires six instantiations each for each one
/// of the Keccak algorithms. Notably, this means that we keep the rate at
/// run-time (relying on the key), and that we request the outputByteLen for the
/// finish function.
inline_for_extraction noextract
let alg = keccak_alg
unfold let coerce (#b #a:Type) (x:a{a == b}) : b = x
inline_for_extraction noextract
let update_multi_s (a : alg) acc (prevlen : nat) input =
Agile.update_multi a acc () input
noextract
let update_multi_zero (a : alg) acc (prevlen : nat) :
Lemma(update_multi_s a acc prevlen S.empty == acc) = Spec.Hash.Lemmas.update_multi_zero a acc
// TODO: this is the fourth copy of this lemma!! why?!
#push-options "--ifuel 1"
noextract
let update_multi_associative (a : alg) acc (prevlen1 prevlen2 : nat)
(input1 input2 : S.seq uint8) :
Lemma
(requires (
prevlen1 % U32.v (D.block_len a) = 0 /\
S.length input1 % U32.v (D.block_len a) = 0 /\
S.length input2 % U32.v (D.block_len a) = 0 /\
prevlen2 = prevlen1 + S.length input1))
(ensures (
let input = S.append input1 input2 in
S.length input % U32.v (D.block_len a) = 0 /\
prevlen2 % U32.v (D.block_len a) = 0 /\
update_multi_s a (update_multi_s a acc prevlen1 input1) prevlen2 input2 ==
update_multi_s a acc prevlen1 input)) =
Spec.Hash.Lemmas.update_multi_associative a acc input1 input2
#pop-options
inline_for_extraction noextract
let singleton #t (x: t) = y:t { y == x }
// Pretty C name
let hash_buf = hash_alg & B.buffer uint64
let hash_buf2 = hash_buf & hash_buf
inline_for_extraction noextract
let stateful_keccak: stateful alg =
Stateful
(* s: *) (fun (a: alg) ->
singleton a & b:B.buffer uint64 { B.len b == 25ul })
(* footprint: *) (fun #_ h (_, s) ->
B.loc_addr_of_buffer s)
(* freeable: *) (fun #_ h (_, s) ->
B.freeable s)
(* invariant: *) (fun #_ h (_, s) ->
B.live h s)
(* t: *) (fun _ ->
s:S.seq uint64 { S.length s == 25 })
(* v: *) (fun _ h (a, s) ->
B.as_seq h s)
(* invariant_loc_in_footprint: *) (fun #_ h (_, s) ->
())
(* frame_invariant: *) (fun #_ l (_, s) h0 h1 ->
())
(* frame_freeable: *) (fun #_ l (_, s) h0 h1 ->
())
(* alloca: *) (fun (a: alg) ->
a, B.alloca (Lib.IntTypes.u64 0) 25ul)
(* malloc: *) (fun a r ->
a, B.malloc r (Lib.IntTypes.u64 0) 25ul)
(* free: *) (fun _ (_, s) ->
B.free s)
(* copy: *) (fun _ (a, s_src) (a', s_dst) ->
B.blit s_src 0ul s_dst 0ul 25ul)
noextract inline_for_extraction
let is_shake_ a = a = Shake128 || a = Shake256 | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fsti.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Streaming.Types.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.SHA3.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Keccak.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "Agile"
},
{
"abbrev": true,
"full_module": "Hacl.Hash.Definitions",
"short_module": "D"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"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_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Ghost.erased Hacl.Streaming.Keccak.alg
-> Hacl.Streaming.Interface.block Hacl.Streaming.Keccak.alg | Prims.Tot | [
"total"
] | [] | [
"FStar.Ghost.erased",
"Hacl.Streaming.Keccak.alg",
"Hacl.Streaming.Interface.Block",
"Hacl.Streaming.Interface.Erased",
"Hacl.Streaming.Keccak.stateful_keccak",
"Hacl.Streaming.Interface.stateful_unused",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_GreaterThan",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Prims.unit",
"Prims._assert",
"Prims.l_Forall",
"Prims.eq2",
"FStar.UInt64.t",
"Prims.l_or",
"Prims.l_and",
"Prims.op_LessThan",
"FStar.UInt64.v",
"Spec.Hash.Definitions.less_than_max_input_length",
"Prims.op_Equality",
"Prims.int",
"Lib.IntTypes.U64",
"Lib.IntTypes.ones_v",
"Hacl.Hash.Definitions.max_input_len64",
"Lib.IntTypes.int_t",
"Lib.IntTypes.ones",
"FStar.Integers.op_Greater",
"FStar.Integers.Signed",
"FStar.Integers.Winfinite",
"Hacl.Streaming.Keccak.is_shake_",
"Prims.bool",
"Spec.Hash.Definitions.hash_length",
"Lib.IntTypes.size_nat",
"Hacl.Hash.SHA3.block_len",
"FStar.UInt32.__uint_to_t",
"FStar.UInt32.t",
"FStar.Integers.op_Less_Equals",
"FStar.UInt32.v",
"Hacl.Streaming.Interface.__proj__Stateful__item__t",
"FStar.Seq.Base.empty",
"Hacl.Streaming.Interface.uint8",
"FStar.Seq.Base.seq",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.Seq.Base.length",
"Spec.Agile.Hash.init",
"FStar.Integers.nat",
"FStar.Integers.op_Percent",
"FStar.Integers.op_Plus",
"Hacl.Streaming.Keccak.update_multi_s",
"Spec.Hash.Incremental.Definitions.update_last",
"Spec.Agile.Hash.finish",
"Spec.Hash.Definitions.output_length",
"Prims.nat",
"Spec.Agile.Hash.hash'",
"Hacl.Streaming.Keccak.update_multi_zero",
"Hacl.Streaming.Keccak.update_multi_associative",
"Spec.Hash.Incremental.hash_is_hash_incremental'",
"FStar.Seq.Base.equal",
"FStar.Seq.Base.append",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"FStar.Ghost.reveal",
"Hacl.Streaming.Keccak.singleton",
"LowStar.Buffer.buffer",
"Hacl.Streaming.Keccak.uint64",
"LowStar.Monotonic.Buffer.len",
"LowStar.Buffer.trivial_preorder",
"LowStar.Monotonic.Buffer.length",
"Hacl.Hash.SHA3.init",
"Hacl.Hash.SHA3.update_multi",
"FStar.UInt32.div",
"Hacl.Hash.SHA3.update_last",
"Hacl.Streaming.Interface.optional_key",
"Hacl.Hash.SHA3.finish_keccak",
"Hacl.Streaming.Interface.block"
] | [] | false | false | false | true | false | let hacl_keccak (a: G.erased alg) : block alg =
| Block Erased
stateful_keccak
(stateful_unused alg)
Lib.IntTypes.(x: size_t{v x > 0})
(fun _ ->
[@@ inline_let ]let max = let open Lib.IntTypes in ones U64 PUB in
assert (forall (a: alg). Hacl.Hash.Definitions.max_input_len64 a == max);
max)
(fun a l -> if is_shake_ a then Lib.IntTypes.v l else Spec.Hash.Definitions.hash_length a)
Hacl.Hash.SHA3.block_len
Hacl.Hash.SHA3.block_len
(fun _ -> 0ul)
(fun _ _ -> S.empty)
(fun a _ -> Spec.Agile.Hash.init a)
(fun a acc prevlen blocks -> update_multi_s a acc prevlen blocks)
(fun a acc prevlen input -> let open Spec.Hash.Incremental in update_last a acc () input)
(fun a _ acc l -> Spec.Agile.Hash.finish a acc (if is_shake_ a then (Lib.IntTypes.v l)))
(fun a _ s l -> let open Spec.Agile.Hash in hash' a s (if is_shake_ a then (Lib.IntTypes.v l)))
(fun a h prevlen -> update_multi_zero a h prevlen)
(fun a acc prevlen1 prevlen2 input1 input2 ->
update_multi_associative a acc prevlen1 prevlen2 input1 input2)
(fun a _ input l ->
let input1 = S.append S.empty input in
assert (S.equal input1 input);
Spec.Hash.Incremental.hash_is_hash_incremental' a
input
(if is_shake_ a then (Lib.IntTypes.v l)))
(fun _ (a, _) -> a)
(fun _ _ _ (a, s) -> Hacl.Hash.SHA3.init a s)
(fun _ (a, s) _ blocks len ->
Hacl.Hash.SHA3.update_multi a s () blocks (len `U32.div` Hacl.Hash.SHA3.(block_len a)))
(fun _ (a, s) _ last last_len -> Hacl.Hash.SHA3.update_last a s () last last_len)
(fun _ _ (a, s) dst l -> let open Hacl.Hash.SHA3 in finish_keccak a s dst l) | false |
Steel.MonotonicCounter.fst | Steel.MonotonicCounter.increasing | val increasing:preorder nat | val increasing:preorder nat | let increasing : preorder nat = fun (x y:nat) -> b2t (x <= y) | {
"file_name": "lib/steel/Steel.MonotonicCounter.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 61,
"end_line": 42,
"start_col": 0,
"start_line": 42
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicCounter
open FStar.PCM
open Steel.Preorder
open FStar.Preorder
/// This small module is an experiment that demonstrate how to use [Steel.Preorder] to define
/// a monotonically increasing counter.
(* The PCM corresponding to the monotonically increasing counter is just the maximum element *)
let pre_pcm : pcm' nat = {
composable=(fun x y -> True);
op=(fun (x y:nat) -> Math.Lib.max x y);
one=0
}
let mctr_pcm : pcm nat = {
p=pre_pcm;
comm=(fun _ _ -> ());
assoc=(fun _ _ _ -> ());
assoc_r=(fun _ _ _ -> ());
is_unit=(fun _ -> ());
refine=(fun _ -> True);
} | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Math.Lib.fst.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicCounter.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.Preorder.preorder Prims.nat | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.logical"
] | [] | false | false | false | true | false | let increasing:preorder nat =
| fun (x: nat) (y: nat) -> b2t (x <= y) | false |
Steel.MonotonicCounter.fst | Steel.MonotonicCounter.mctr_induces_increases | val mctr_induces_increases:squash (induces_preorder mctr_pcm increasing) | val mctr_induces_increases:squash (induces_preorder mctr_pcm increasing) | let mctr_induces_increases
: squash (induces_preorder mctr_pcm increasing)
= let aux (x y:nat) (f:frame_preserving_upd mctr_pcm x y) (v:nat)
: Lemma (requires compatible mctr_pcm x v)
(ensures increasing v (f v))
[SMTPat ()]
= assert (composable mctr_pcm x v)
in
() | {
"file_name": "lib/steel/Steel.MonotonicCounter.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 6,
"end_line": 54,
"start_col": 0,
"start_line": 46
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicCounter
open FStar.PCM
open Steel.Preorder
open FStar.Preorder
/// This small module is an experiment that demonstrate how to use [Steel.Preorder] to define
/// a monotonically increasing counter.
(* The PCM corresponding to the monotonically increasing counter is just the maximum element *)
let pre_pcm : pcm' nat = {
composable=(fun x y -> True);
op=(fun (x y:nat) -> Math.Lib.max x y);
one=0
}
let mctr_pcm : pcm nat = {
p=pre_pcm;
comm=(fun _ _ -> ());
assoc=(fun _ _ _ -> ());
assoc_r=(fun _ _ _ -> ());
is_unit=(fun _ -> ());
refine=(fun _ -> True);
}
(** This is a classical preorder for monotonic increase *)
let increasing : preorder nat = fun (x y:nat) -> b2t (x <= y)
(** Indeed, the [increasing] preorder is induced by the PCM *) | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Math.Lib.fst.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicCounter.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.squash (Steel.Preorder.induces_preorder Steel.MonotonicCounter.mctr_pcm
Steel.MonotonicCounter.increasing) | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"FStar.PCM.frame_preserving_upd",
"Steel.MonotonicCounter.mctr_pcm",
"Prims.unit",
"FStar.PCM.compatible",
"Prims.squash",
"Steel.MonotonicCounter.increasing",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil",
"Prims._assert",
"FStar.PCM.composable"
] | [] | false | false | true | true | false | let mctr_induces_increases:squash (induces_preorder mctr_pcm increasing) =
| let aux (x y: nat) (f: frame_preserving_upd mctr_pcm x y) (v: nat)
: Lemma (requires compatible mctr_pcm x v) (ensures increasing v (f v)) [SMTPat ()] =
assert (composable mctr_pcm x v)
in
() | false |
Steel.MonotonicCounter.fst | Steel.MonotonicCounter.test | val test (x z: nat) (f: (nat -> prop){stable f increasing})
: Lemma (requires (compatible mctr_pcm x z /\ f x)) (ensures f z) | val test (x z: nat) (f: (nat -> prop){stable f increasing})
: Lemma (requires (compatible mctr_pcm x z /\ f x)) (ensures f z) | let test (x z:nat) (f:(nat -> prop){stable f increasing})
: Lemma
(requires (compatible mctr_pcm x z /\ f x))
(ensures f z)
= assert (increasing x z) | {
"file_name": "lib/steel/Steel.MonotonicCounter.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 27,
"end_line": 62,
"start_col": 0,
"start_line": 58
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicCounter
open FStar.PCM
open Steel.Preorder
open FStar.Preorder
/// This small module is an experiment that demonstrate how to use [Steel.Preorder] to define
/// a monotonically increasing counter.
(* The PCM corresponding to the monotonically increasing counter is just the maximum element *)
let pre_pcm : pcm' nat = {
composable=(fun x y -> True);
op=(fun (x y:nat) -> Math.Lib.max x y);
one=0
}
let mctr_pcm : pcm nat = {
p=pre_pcm;
comm=(fun _ _ -> ());
assoc=(fun _ _ _ -> ());
assoc_r=(fun _ _ _ -> ());
is_unit=(fun _ -> ());
refine=(fun _ -> True);
}
(** This is a classical preorder for monotonic increase *)
let increasing : preorder nat = fun (x y:nat) -> b2t (x <= y)
(** Indeed, the [increasing] preorder is induced by the PCM *)
#push-options "--warn_error -271"
let mctr_induces_increases
: squash (induces_preorder mctr_pcm increasing)
= let aux (x y:nat) (f:frame_preserving_upd mctr_pcm x y) (v:nat)
: Lemma (requires compatible mctr_pcm x v)
(ensures increasing v (f v))
[SMTPat ()]
= assert (composable mctr_pcm x v)
in
()
#pop-options | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Math.Lib.fst.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicCounter.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x: Prims.nat ->
z: Prims.nat ->
f: (_: Prims.nat -> Prims.prop){FStar.Preorder.stable f Steel.MonotonicCounter.increasing}
-> FStar.Pervasives.Lemma
(requires FStar.PCM.compatible Steel.MonotonicCounter.mctr_pcm x z /\ f x) (ensures f z) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"Prims.prop",
"FStar.Preorder.stable",
"Steel.MonotonicCounter.increasing",
"Prims._assert",
"Prims.unit",
"Prims.l_and",
"FStar.PCM.compatible",
"Steel.MonotonicCounter.mctr_pcm",
"Prims.squash",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let test (x z: nat) (f: (nat -> prop){stable f increasing})
: Lemma (requires (compatible mctr_pcm x z /\ f x)) (ensures f z) =
| assert (increasing x z) | false |
Steel.MonotonicCounter.fst | Steel.MonotonicCounter.pre_pcm | val pre_pcm:pcm' nat | val pre_pcm:pcm' nat | let pre_pcm : pcm' nat = {
composable=(fun x y -> True);
op=(fun (x y:nat) -> Math.Lib.max x y);
one=0
} | {
"file_name": "lib/steel/Steel.MonotonicCounter.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 1,
"end_line": 31,
"start_col": 0,
"start_line": 27
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicCounter
open FStar.PCM
open Steel.Preorder
open FStar.Preorder
/// This small module is an experiment that demonstrate how to use [Steel.Preorder] to define
/// a monotonically increasing counter. | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Math.Lib.fst.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicCounter.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.PCM.pcm' Prims.nat | Prims.Tot | [
"total"
] | [] | [
"FStar.PCM.Mkpcm'",
"Prims.nat",
"Prims.l_True",
"Prims.prop",
"FStar.Math.Lib.max"
] | [] | false | false | false | true | false | let pre_pcm:pcm' nat =
| { composable = (fun x y -> True); op = (fun (x: nat) (y: nat) -> Math.Lib.max x y); one = 0 } | false |
Steel.MonotonicCounter.fst | Steel.MonotonicCounter.mctr_pcm | val mctr_pcm:pcm nat | val mctr_pcm:pcm nat | let mctr_pcm : pcm nat = {
p=pre_pcm;
comm=(fun _ _ -> ());
assoc=(fun _ _ _ -> ());
assoc_r=(fun _ _ _ -> ());
is_unit=(fun _ -> ());
refine=(fun _ -> True);
} | {
"file_name": "lib/steel/Steel.MonotonicCounter.fst",
"git_rev": "f984200f79bdc452374ae994a5ca837496476c41",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | {
"end_col": 1,
"end_line": 39,
"start_col": 0,
"start_line": 32
} | (*
Copyright 2020 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module Steel.MonotonicCounter
open FStar.PCM
open Steel.Preorder
open FStar.Preorder
/// This small module is an experiment that demonstrate how to use [Steel.Preorder] to define
/// a monotonically increasing counter.
(* The PCM corresponding to the monotonically increasing counter is just the maximum element *)
let pre_pcm : pcm' nat = {
composable=(fun x y -> True);
op=(fun (x y:nat) -> Math.Lib.max x y);
one=0 | {
"checked_file": "/",
"dependencies": [
"Steel.Preorder.fst.checked",
"prims.fst.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Math.Lib.fst.checked"
],
"interface_file": false,
"source_file": "Steel.MonotonicCounter.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.PCM.pcm Prims.nat | Prims.Tot | [
"total"
] | [] | [
"FStar.PCM.Mkpcm",
"Prims.nat",
"Steel.MonotonicCounter.pre_pcm",
"FStar.PCM.__proj__Mkpcm'__item__composable",
"Prims.unit",
"Prims.l_and",
"FStar.PCM.__proj__Mkpcm'__item__op",
"Prims.l_True",
"Prims.prop"
] | [] | false | false | false | true | false | let mctr_pcm:pcm nat =
| {
p = pre_pcm;
comm = (fun _ _ -> ());
assoc = (fun _ _ _ -> ());
assoc_r = (fun _ _ _ -> ());
is_unit = (fun _ -> ());
refine = (fun _ -> True)
} | false |
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred2 | val pred2 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred2 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 47,
"start_col": 0,
"start_line": 47
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred2 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.lpred1 | val lpred1 : l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | let lpred1 (l1 l2 : Seq.seq int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 53,
"start_col": 0,
"start_line": 53
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let lpred1 (l1 l2: Seq.seq int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred3 | val pred3 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred3 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 48,
"start_col": 0,
"start_line": 48
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred3 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred5 | val pred5 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred5 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 50,
"start_col": 0,
"start_line": 50
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred5 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred1 | val pred1 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred1 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 46,
"start_col": 0,
"start_line": 46
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred1 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred6 | val pred6 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred6 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 51,
"start_col": 0,
"start_line": 51
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred6 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.lpred3 | val lpred3 : l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | let lpred3 (l1 l2 : Seq.seq int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 55,
"start_col": 0,
"start_line": 55
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True
let lpred1 (l1 l2 : Seq.seq int) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let lpred3 (l1 l2: Seq.seq int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.lpred2 | val lpred2 : l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | let lpred2 (l1 l2 : Seq.seq int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 39,
"end_line": 54,
"start_col": 0,
"start_line": 54
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l1: FStar.Seq.Base.seq Prims.int -> l2: FStar.Seq.Base.seq Prims.int -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let lpred2 (l1 l2: Seq.seq int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.spred1 | val spred1 : h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | let spred1 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 57,
"start_col": 0,
"start_line": 57
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True
let lpred1 (l1 l2 : Seq.seq int) = True
let lpred2 (l1 l2 : Seq.seq int) = True
let lpred3 (l1 l2 : Seq.seq int) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"LowStar.Buffer.buffer",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let spred1 (h: HS.mem) (r1 r2 r3: B.buffer int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.pred4 | val pred4 : x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | let pred4 (x y z : nat) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 30,
"end_line": 49,
"start_col": 0,
"start_line": 49
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> z: Prims.nat -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let pred4 (x y z: nat) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.spred3 | val spred3 : h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | let spred3 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 59,
"start_col": 0,
"start_line": 59
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True
let lpred1 (l1 l2 : Seq.seq int) = True
let lpred2 (l1 l2 : Seq.seq int) = True
let lpred3 (l1 l2 : Seq.seq int) = True
let spred1 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"LowStar.Buffer.buffer",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let spred3 (h: HS.mem) (r1 r2 r3: B.buffer int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.spred4 | val spred4 : h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | let spred4 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 60,
"start_col": 0,
"start_line": 60
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True
let lpred1 (l1 l2 : Seq.seq int) = True
let lpred2 (l1 l2 : Seq.seq int) = True
let lpred3 (l1 l2 : Seq.seq int) = True
let spred1 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True
let spred2 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"LowStar.Buffer.buffer",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let spred4 (h: HS.mem) (r1 r2 r3: B.buffer int) =
| True | false |
|
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.spred2 | val spred2 : h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | let spred2 (h : HS.mem) (r1 r2 r3 : B.buffer int) = True | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 56,
"end_line": 58,
"start_col": 0,
"start_line": 58
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x
let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2
assume val sf1 (r : B.buffer int) :
ST.Stack int
(requires (fun _ -> True))
(ensures (fun h0 n h1 ->
B.live h0 r /\ B.as_seq h0 r == B.as_seq h1 r /\
n = List.Tot.fold_left (fun x y -> x + y) 0 (Seq.seq_to_list (B.as_seq h0 r))))
assume val sf2 (l : list int) :
ST.ST (B.buffer int)
(requires (fun _ -> True))
(ensures (fun h0 r h1 ->
B.live h0 r /\
B.as_seq h1 r == Seq.seq_of_list l))
assume val sf3 : b:B.buffer nat ->
ST.Stack unit (requires (fun h0 -> B.live h0 b))
(ensures (fun h0 r h1 -> B.live h1 b))
let pred1 (x y z : nat) = True
let pred2 (x y z : nat) = True
let pred3 (x y z : nat) = True
let pred4 (x y z : nat) = True
let pred5 (x y z : nat) = True
let pred6 (x y z : nat) = True
let lpred1 (l1 l2 : Seq.seq int) = True
let lpred2 (l1 l2 : Seq.seq int) = True
let lpred3 (l1 l2 : Seq.seq int) = True | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
h: FStar.Monotonic.HyperStack.mem ->
r1: LowStar.Buffer.buffer Prims.int ->
r2: LowStar.Buffer.buffer Prims.int ->
r3: LowStar.Buffer.buffer Prims.int
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Monotonic.HyperStack.mem",
"LowStar.Buffer.buffer",
"Prims.int",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | true | true | let spred2 (h: HS.mem) (r1 r2 r3: B.buffer int) =
| True | false |
|
FStar.Preorder.fst | FStar.Preorder.reflexive | val reflexive : rel: FStar.Preorder.relation a -> Prims.logical | let reflexive (#a:Type) (rel:relation a) =
forall (x:a). rel x x | {
"file_name": "ulib/FStar.Preorder.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 23,
"end_line": 25,
"start_col": 0,
"start_line": 24
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Preorder
(* Preordered relations and stable predicates *)
type relation (a:Type) = a -> a -> Type0
type predicate (a:Type) = a -> Type0 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Preorder.fst"
} | [
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rel: FStar.Preorder.relation a -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Preorder.relation",
"Prims.l_Forall",
"Prims.logical"
] | [] | false | false | false | true | true | let reflexive (#a: Type) (rel: relation a) =
| forall (x: a). rel x x | false |
|
FStar.Preorder.fst | FStar.Preorder.transitive | val transitive : rel: FStar.Preorder.relation a -> Prims.logical | let transitive (#a:Type) (rel:relation a) =
forall (x:a) (y:a) (z:a). (rel x y /\ rel y z) ==> rel x z | {
"file_name": "ulib/FStar.Preorder.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 60,
"end_line": 28,
"start_col": 0,
"start_line": 27
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Preorder
(* Preordered relations and stable predicates *)
type relation (a:Type) = a -> a -> Type0
type predicate (a:Type) = a -> Type0
let reflexive (#a:Type) (rel:relation a) =
forall (x:a). rel x x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Preorder.fst"
} | [
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rel: FStar.Preorder.relation a -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Preorder.relation",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.l_and",
"Prims.logical"
] | [] | false | false | false | true | true | let transitive (#a: Type) (rel: relation a) =
| forall (x: a) (y: a) (z: a). (rel x y /\ rel y z) ==> rel x z | false |
|
FStar.Preorder.fst | FStar.Preorder.preorder_rel | val preorder_rel : rel: FStar.Preorder.relation a -> Prims.logical | let preorder_rel (#a:Type) (rel:relation a) =
reflexive rel /\ transitive rel | {
"file_name": "ulib/FStar.Preorder.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 33,
"end_line": 31,
"start_col": 0,
"start_line": 30
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Preorder
(* Preordered relations and stable predicates *)
type relation (a:Type) = a -> a -> Type0
type predicate (a:Type) = a -> Type0
let reflexive (#a:Type) (rel:relation a) =
forall (x:a). rel x x
let transitive (#a:Type) (rel:relation a) =
forall (x:a) (y:a) (z:a). (rel x y /\ rel y z) ==> rel x z | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Preorder.fst"
} | [
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rel: FStar.Preorder.relation a -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Preorder.relation",
"Prims.l_and",
"FStar.Preorder.reflexive",
"FStar.Preorder.transitive",
"Prims.logical"
] | [] | false | false | false | true | true | let preorder_rel (#a: Type) (rel: relation a) =
| reflexive rel /\ transitive rel | false |
|
FStar.Preorder.fst | FStar.Preorder.stable | val stable : p: FStar.Preorder.predicate a -> rel: FStar.Preorder.relation a {FStar.Preorder.preorder_rel rel}
-> Prims.logical | let stable (#a:Type) (p:predicate a) (rel:relation a{preorder_rel rel}) =
forall (x:a) (y:a). (p x /\ rel x y) ==> p y | {
"file_name": "ulib/FStar.Preorder.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 46,
"end_line": 36,
"start_col": 0,
"start_line": 35
} | (*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Preorder
(* Preordered relations and stable predicates *)
type relation (a:Type) = a -> a -> Type0
type predicate (a:Type) = a -> Type0
let reflexive (#a:Type) (rel:relation a) =
forall (x:a). rel x x
let transitive (#a:Type) (rel:relation a) =
forall (x:a) (y:a) (z:a). (rel x y /\ rel y z) ==> rel x z
let preorder_rel (#a:Type) (rel:relation a) =
reflexive rel /\ transitive rel
type preorder (a:Type) = rel:relation a{preorder_rel rel} | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Preorder.fst"
} | [
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p: FStar.Preorder.predicate a -> rel: FStar.Preorder.relation a {FStar.Preorder.preorder_rel rel}
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Preorder.predicate",
"FStar.Preorder.relation",
"FStar.Preorder.preorder_rel",
"Prims.l_Forall",
"Prims.l_imp",
"Prims.l_and",
"Prims.logical"
] | [] | false | false | false | false | true | let stable (#a: Type) (p: predicate a) (rel: relation a {preorder_rel rel}) =
| forall (x: a) (y: a). (p x /\ rel x y) ==> p y | false |
|
LowParse.SLow.List.fst | LowParse.SLow.List.list_rev_inv | val list_rev_inv (#t: Type) (l: list t) (b: bool) (x: (list t * list t)) : GTot Type0 | val list_rev_inv (#t: Type) (l: list t) (b: bool) (x: (list t * list t)) : GTot Type0 | let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == []) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 28,
"end_line": 100,
"start_col": 0,
"start_line": 92
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b [] | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.list t -> b: Prims.bool -> x: (Prims.list t * Prims.list t) -> Prims.GTot Type0 | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.list",
"Prims.bool",
"FStar.Pervasives.Native.tuple2",
"Prims.l_and",
"Prims.eq2",
"FStar.List.Tot.Base.rev",
"FStar.List.Tot.Base.rev_acc",
"Prims.l_imp",
"Prims.Nil"
] | [] | false | false | false | false | true | let list_rev_inv (#t: Type) (l: list t) (b: bool) (x: list t * list t) : GTot Type0 =
| let rem, acc = x in
L.rev l == L.rev_acc rem acc /\ (b == false ==> rem == []) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.partial_serialize32_list'_measure | val partial_serialize32_list'_measure (#t: Type) (x: (bytes32 * list t)) : GTot nat | val partial_serialize32_list'_measure (#t: Type) (x: (bytes32 * list t)) : GTot nat | let partial_serialize32_list'_measure
(#t: Type)
(x: bytes32 * list t)
: GTot nat
= L.length (snd x) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 18,
"end_line": 296,
"start_col": 0,
"start_line": 292
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu')
inline_for_extraction
let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } ))
let rec partial_serialize32_list'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
serializer32_correct (serialize_list p s) input res
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
let res = B32.empty_bytes in
assert (Seq.equal (B32.reveal res) (Seq.empty));
res
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let sq = partial_serialize32_list' p s s32 q in
let res = B32.append sa sq in
res
let rec partial_serialize32_list_tailrec'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(accu: bytes32)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
B32.length accu + Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
B32.reveal res == Seq.append (B32.reveal accu) (B32.reveal (partial_serialize32_list' p s s32 input))
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
Seq.append_empty_r (B32.reveal accu);
accu
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let accu' = B32.append accu sa in
Seq.append_assoc (B32.reveal accu) (B32.reveal sa) (B32.reveal (partial_serialize32_list' p s s32 q));
partial_serialize32_list_tailrec' p s s32 accu' q
let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0
= serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\ (
let (accu, input') = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct
(serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)
) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: (LowParse.SLow.Base.bytes32 * Prims.list t) -> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Pervasives.Native.tuple2",
"LowParse.SLow.Base.bytes32",
"Prims.list",
"FStar.List.Tot.Base.length",
"FStar.Pervasives.Native.snd",
"Prims.nat"
] | [] | false | false | false | false | false | let partial_serialize32_list'_measure (#t: Type) (x: bytes32 * list t) : GTot nat =
| L.length (snd x) | false |
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.f4 | val f4 (n: int{n % 2 = 0}) : Tot (n': int{n' % 2 = 0}) | val f4 (n: int{n % 2 = 0}) : Tot (n': int{n' % 2 = 0}) | let f4 (n : int{n % 2 = 0}) : Tot (n':int{n' % 2 = 0}) =
n + 2 | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 7,
"end_line": 26,
"start_col": 0,
"start_line": 25
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8
let f3 (x : nat) : nat =
2 * x | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.int{n % 2 = 0} -> n': Prims.int{n' % 2 = 0} | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Prims.b2t",
"Prims.op_Equality",
"Prims.op_Modulus",
"Prims.op_Addition"
] | [] | false | false | false | false | false | let f4 (n: int{n % 2 = 0}) : Tot (n': int{n' % 2 = 0}) =
| n + 2 | false |
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.f1 | val f1 (n: int) (m: nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) | val f1 (n: int) (m: nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) | let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3) | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 16,
"start_col": 0,
"start_line": 15
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.int -> m: Prims.nat -> Prims.Pure Prims.nat | Prims.Pure | [] | [] | [
"Prims.int",
"Prims.nat",
"Prims.op_Modulus",
"Prims.op_Subtraction",
"Prims.b2t",
"Prims.op_GreaterThan",
"Prims.l_True"
] | [] | false | false | false | false | false | let f1 (n: int) (m: nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
| m % (n - 3) | false |
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.f2 | val f2 (x y: nat) : Pure (z: nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) | val f2 (x y: nat) : Pure (z: nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) | let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8 | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 17,
"end_line": 20,
"start_col": 0,
"start_line": 18
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> y: Prims.nat -> Prims.Pure (z: Prims.nat{z >= 8}) | Prims.Pure | [] | [] | [
"Prims.nat",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"Prims.l_True",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus"
] | [] | false | false | false | false | false | let f2 (x y: nat) : Pure (z: nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
| 2 * (x + y) + 8 | false |
FStar.InteractiveHelpers.Tutorial.Definitions.fst | FStar.InteractiveHelpers.Tutorial.Definitions.f3 | val f3 (x: nat) : nat | val f3 (x: nat) : nat | let f3 (x : nat) : nat =
2 * x | {
"file_name": "examples/interactive/FStar.InteractiveHelpers.Tutorial.Definitions.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 7,
"end_line": 23,
"start_col": 0,
"start_line": 22
} | module FStar.InteractiveHelpers.Tutorial.Definitions
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
module B = LowStar.Buffer
open FStar.List
open FStar.Tactics.V2
open FStar.Mul
/// Some dummy functions used for the tutorial for the FStar.FStar.InteractiveHelpers functions
#push-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let f1 (n : int) (m : nat) : Pure nat (requires (n > 3)) (ensures (fun _ -> True)) =
m % (n - 3)
let f2 (x y : nat) :
Pure (z:nat{z >= 8}) (requires True) (ensures (fun z -> z % 2 = 0)) =
2 * (x + y) + 8 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "FStar.InteractiveHelpers.Tutorial.Definitions.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.InteractiveHelpers.Tutorial",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: Prims.nat -> Prims.nat | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"FStar.Mul.op_Star"
] | [] | false | false | false | true | false | let f3 (x: nat) : nat =
| 2 * x | false |
LowParse.SLow.List.fst | LowParse.SLow.List.size32_list_measure | val size32_list_measure (#t: Type) (accu: (U32.t * list t)) : GTot nat | val size32_list_measure (#t: Type) (accu: (U32.t * list t)) : GTot nat | let size32_list_measure
(#t: Type)
(accu: (U32.t * list t))
: GTot nat
= let (_, rem) = accu in
L.length rem | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 14,
"end_line": 394,
"start_col": 0,
"start_line": 389
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu')
inline_for_extraction
let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } ))
let rec partial_serialize32_list'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
serializer32_correct (serialize_list p s) input res
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
let res = B32.empty_bytes in
assert (Seq.equal (B32.reveal res) (Seq.empty));
res
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let sq = partial_serialize32_list' p s s32 q in
let res = B32.append sa sq in
res
let rec partial_serialize32_list_tailrec'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(accu: bytes32)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
B32.length accu + Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
B32.reveal res == Seq.append (B32.reveal accu) (B32.reveal (partial_serialize32_list' p s s32 input))
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
Seq.append_empty_r (B32.reveal accu);
accu
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let accu' = B32.append accu sa in
Seq.append_assoc (B32.reveal accu) (B32.reveal sa) (B32.reveal (partial_serialize32_list' p s s32 q));
partial_serialize32_list_tailrec' p s s32 accu' q
let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0
= serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\ (
let (accu, input') = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct
(serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)
)
let partial_serialize32_list'_measure
(#t: Type)
(x: bytes32 * list t)
: GTot nat
= L.length (snd x)
inline_for_extraction
let partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: (x: (bytes32 * list t)) ->
Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures (fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==> partial_serialize32_list'_measure y < partial_serialize32_list'_measure x)
))
= fun (x: bytes32 * list t) ->
let (accu, input') = x in
match input' with
| [] -> (false, x)
| a :: q ->
[@inline_let]
let _ = serialize_list_cons p s a q in
let sa = s32 a in
let accu' = B32.append accu sa in
(true, (accu', q))
let partial_serialize32_list'_init
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Lemma
(requires (
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296
))
(ensures (
partial_serialize32_list'_inv p s s32 input true (B32.empty_bytes, input)
))
= assert (Seq.equal (B32.reveal B32.empty_bytes) Seq.empty);
Seq.append_empty_l (B32.reveal (partial_serialize32_list' p s s32 input));
assert (B32.reveal (partial_serialize32_list' p s s32 input) == B32.reveal (partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input));
assert (serializer32_correct (serialize_list p s) input (partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input))
inline_for_extraction
let partial_serialize32_list
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(u: unit {
serialize_list_precond k
})
: Tot (partial_serializer32 (serialize_list p s))
= fun (input: list t { Seq.length (serialize (serialize_list p s) input) < 4294967296 } ) -> ((
let (res, _) =
partial_serialize32_list'_init p s s32 input;
CL.total_while
partial_serialize32_list'_measure
(partial_serialize32_list'_inv p s s32 input)
(fun x -> partial_serialize32_list'_body p s s32 input x)
(B32.empty_bytes, input)
in
res
) <: (res: bytes32 { serializer32_correct (serialize_list p s) input res }))
let size32_list_inv
(#t: Type)
(#k: parser_kind)
(#p: parser k t)
(#s: serializer p)
(s32: size32 s)
(u: unit {
serialize_list_precond k
})
(input: list t)
(continue: bool)
(accu: (U32.t * list t))
: GTot Type0
= let (len, rem) = accu in
let sz = Seq.length (serialize (serialize_list p s) input) in
if continue
then
U32.v len < U32.v u32_max /\
sz == U32.v len + Seq.length (serialize (serialize_list p s) rem)
else
size32_postcond (serialize_list p s) input len | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | accu: (FStar.UInt32.t * Prims.list t) -> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Pervasives.Native.tuple2",
"FStar.UInt32.t",
"Prims.list",
"FStar.List.Tot.Base.length",
"Prims.nat"
] | [] | false | false | false | false | false | let size32_list_measure (#t: Type) (accu: (U32.t * list t)) : GTot nat =
| let _, rem = accu in
L.length rem | false |
Spec.Curve25519.Lemmas.fst | Spec.Curve25519.Lemmas.lemma_prime_value | val lemma_prime_value: n:nat -> Lemma
(requires (n = 255))
(ensures (pow2 n - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed))
[SMTPat (pow2 n - 19)] | val lemma_prime_value: n:nat -> Lemma
(requires (n = 255))
(ensures (pow2 n - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed))
[SMTPat (pow2 n - 19)] | let lemma_prime_value n = assert_norm(pow2 255 - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed) | {
"file_name": "specs/lemmas/Spec.Curve25519.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 121,
"end_line": 7,
"start_col": 0,
"start_line": 7
} | module Spec.Curve25519.Lemmas
val lemma_prime_value: n:nat -> Lemma
(requires (n = 255))
(ensures (pow2 n - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Spec.Curve25519.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "Spec.Curve25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Curve25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.nat
-> FStar.Pervasives.Lemma (requires n = 255)
(ensures
Prims.pow2 n - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed)
[SMTPat (Prims.pow2 n - 19)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Subtraction",
"Prims.pow2",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_prime_value n =
| assert_norm (pow2 255 - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed) | false |
Spec.Curve25519.Lemmas.fst | Spec.Curve25519.Lemmas.lemma_pow2_256 | val lemma_pow2_256: n:nat -> Lemma
(requires (n = 256))
(ensures (pow2 n = 0x10000000000000000000000000000000000000000000000000000000000000000))
[SMTPat (pow2 n)] | val lemma_pow2_256: n:nat -> Lemma
(requires (n = 256))
(ensures (pow2 n = 0x10000000000000000000000000000000000000000000000000000000000000000))
[SMTPat (pow2 n)] | let lemma_pow2_256 n = assert_norm(pow2 256 = 0x10000000000000000000000000000000000000000000000000000000000000000) | {
"file_name": "specs/lemmas/Spec.Curve25519.Lemmas.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 114,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | module Spec.Curve25519.Lemmas
val lemma_prime_value: n:nat -> Lemma
(requires (n = 255))
(ensures (pow2 n - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed))
[SMTPat (pow2 n - 19)]
let lemma_prime_value n = assert_norm(pow2 255 - 19 = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed)
val lemma_div_n: n:nat -> Lemma
(requires (n > 1))
(ensures (n / 2 < n /\ n / 2 > 0))
[SMTPat (n / 2)]
let lemma_div_n n = ()
val lemma_pow2_256: n:nat -> Lemma
(requires (n = 256))
(ensures (pow2 n = 0x10000000000000000000000000000000000000000000000000000000000000000)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Spec.Curve25519.Lemmas.fst"
} | [
{
"abbrev": false,
"full_module": "Spec.Curve25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Curve25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | n: Prims.nat
-> FStar.Pervasives.Lemma (requires n = 256)
(ensures Prims.pow2 n = 0x10000000000000000000000000000000000000000000000000000000000000000)
[SMTPat (Prims.pow2 n)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.nat",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.pow2",
"Prims.unit"
] | [] | true | false | true | false | false | let lemma_pow2_256 n =
| assert_norm (pow2 256 = 0x10000000000000000000000000000000000000000000000000000000000000000) | false |
MerkleTree.New.High.Correct.Flushing.fst | MerkleTree.New.High.Correct.Flushing.mt_flush_inv_preserved | val mt_flush_inv_preserved:
#hsz:pos ->
mt:merkle_tree #hsz {mt_wf_elts mt /\ MT?.j mt > MT?.i mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
Lemma (requires (mt_inv mt olds))
(ensures (mt_inv (mt_flush mt)
(mt_flush_to_olds #_ #(MT?.hash_fun mt)
0 (MT?.i mt) (MT?.j mt - 1) (MT?.j mt)
olds (MT?.hs mt)))) | val mt_flush_inv_preserved:
#hsz:pos ->
mt:merkle_tree #hsz {mt_wf_elts mt /\ MT?.j mt > MT?.i mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
Lemma (requires (mt_inv mt olds))
(ensures (mt_inv (mt_flush mt)
(mt_flush_to_olds #_ #(MT?.hash_fun mt)
0 (MT?.i mt) (MT?.j mt - 1) (MT?.j mt)
olds (MT?.hs mt)))) | let mt_flush_inv_preserved #hsz mt olds =
mt_flush_to_inv_preserved #hsz mt olds (MT?.j mt - 1) | {
"file_name": "src/MerkleTree.New.High.Correct.Flushing.fst",
"git_rev": "7d7bdc20f2033171e279c176b26e84f9069d23c6",
"git_url": "https://github.com/hacl-star/merkle-tree.git",
"project_name": "merkle-tree"
} | {
"end_col": 55,
"end_line": 161,
"start_col": 0,
"start_line": 160
} | module MerkleTree.New.High.Correct.Flushing
open EverCrypt
open EverCrypt.Helpers
open FStar.Classical
open FStar.Ghost
open FStar.Seq
module List = FStar.List.Tot
module S = FStar.Seq
module U32 = FStar.UInt32
module U8 = FStar.UInt8
type uint32_t = U32.t
type uint8_t = U8.t
module EHS = EverCrypt.Hash
module MTS = MerkleTree.Spec
open MerkleTree.New.High
open MerkleTree.New.High.Correct.Base
/// Correctness of flushing
val mt_flush_to_olds:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
lv:nat{lv < 32} ->
pi:nat ->
i:nat{i >= pi} ->
j:nat{j >= i /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv pi olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs pi j} ->
GTot (folds:hashess #hsz {
S.length folds = 32 /\
S.equal (S.slice olds 0 lv) (S.slice folds 0 lv) /\
mt_olds_inv #hsz lv i folds})
(decreases i)
let rec mt_flush_to_olds #_ #f lv pi i j olds hs =
let oi = offset_of i in
let opi = offset_of pi in
if oi = opi then olds (* no updates *)
else (let nolds =
S.upd olds lv
(S.append (S.index olds lv)
(S.slice (S.index hs lv) 0 (oi - opi))) in
mt_olds_inv_equiv #_ #f (lv + 1) (pi / 2) olds nolds;
mt_flush_to_olds #_ #f (lv + 1) (pi / 2) (i / 2) (j / 2) nolds hs)
val mt_flush_to_olds_hs_equiv:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
lv:nat{lv < 32} ->
pi:nat ->
i:nat{i >= pi} ->
j:nat{j >= i /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv pi olds} ->
hs1:hashess #hsz {S.length hs1 = 32 /\ hs_wf_elts lv hs1 pi j} ->
hs2:hashess #hsz {S.length hs2 = 32 /\ hs_wf_elts lv hs2 pi j} ->
Lemma (requires (S.equal (S.slice hs1 lv 32) (S.slice hs2 lv 32)))
(ensures (S.equal (mt_flush_to_olds #_ #f lv pi i j olds hs1)
(mt_flush_to_olds #_ #f lv pi i j olds hs2)))
(decreases i)
let rec mt_flush_to_olds_hs_equiv #_ #f lv pi i j olds hs1 hs2 =
let oi = offset_of i in
let opi = offset_of pi in
if oi = opi then ()
else (assert (S.index hs1 lv == S.index hs2 lv);
let nolds =
S.upd olds lv
(S.append (S.index olds lv)
(S.slice (S.index hs1 lv) 0 (oi - opi))) in
mt_olds_inv_equiv #_ #f (lv + 1) (pi / 2) olds nolds;
mt_flush_to_olds_hs_equiv #_ #f
(lv + 1) (pi / 2) (i / 2) (j / 2) nolds hs1 hs2)
val mt_flush_to_merge_preserved:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
lv:nat{lv < 32} ->
pi:nat -> i:nat{i >= pi} ->
j:nat{j >= i /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv pi olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs pi j} ->
Lemma (requires True)
(ensures (S.equal (merge_hs #_ #f olds hs)
(merge_hs #_ #f
(mt_flush_to_olds #_ #f lv pi i j olds hs)
(mt_flush_to_ lv hs pi i j))))
(decreases i)
#reset-options "--z3rlimit 40 --max_fuel 2"
let rec mt_flush_to_merge_preserved #_ #f lv pi i j olds hs =
let oi = offset_of i in
let opi = offset_of pi in
if oi = opi then ()
else begin
let nolds = S.upd olds lv
(S.append (S.index olds lv)
(S.slice (S.index hs lv) 0 (oi - opi))) in
let nhs = S.upd hs lv
(S.slice (S.index hs lv) (oi - opi) (j - opi)) in
mt_olds_inv_equiv #_ #f (lv + 1) (pi / 2) olds nolds;
hs_wf_elts_equal (lv + 1) hs nhs (pi / 2) (j / 2);
mt_flush_to_merge_preserved #_ #f
(lv + 1) (pi / 2) (i / 2) (j / 2) nolds nhs;
mt_flush_to_olds_hs_equiv #_ #f
(lv + 1) (pi / 2) (i / 2) (j / 2) nolds hs nhs;
assert (S.equal (merge_hs #_ #f nolds nhs)
(merge_hs #_ #f
(mt_flush_to_olds #_ #f lv pi i j olds hs)
(mt_flush_to_ lv hs pi i j)));
merge_hs_upd #_ #f olds hs lv
(S.append (S.index olds lv) (S.slice (S.index hs lv) 0 (oi - opi)))
(S.slice (S.index hs lv) (oi - opi) (j - opi));
assert (S.equal (merge_hs #_ #f olds hs) (merge_hs #_ #f nolds nhs))
end
#reset-options
val mt_flush_to_inv_preserved_:
#hsz:pos -> #f:MTS.hash_fun_t #hsz ->
lv:nat{lv < 32} ->
pi:nat -> i:nat{i >= pi} ->
j:nat{j >= i /\ j < pow2 (32 - lv)} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz lv pi olds} ->
hs:hashess #hsz {S.length hs = 32 /\ hs_wf_elts lv hs pi j} ->
Lemma (requires (mt_olds_hs_inv #_ #f lv pi j olds hs))
(ensures (mt_olds_hs_inv #_ #f lv i j
(mt_flush_to_olds #_ #f lv pi i j olds hs)
(mt_flush_to_ lv hs pi i j)))
let mt_flush_to_inv_preserved_ #_ #f lv pi i j olds hs =
mt_flush_to_merge_preserved #_ #f lv pi i j olds hs;
mt_olds_hs_lth_inv_ok #_ #f lv pi j olds hs;
mt_hashes_lth_inv_equiv #_ #f lv j
(merge_hs #_ #f olds hs)
(merge_hs #_ #f (mt_flush_to_olds #_ #f lv pi i j olds hs)
(mt_flush_to_ lv hs pi i j));
mt_hashes_inv_equiv #_ #f lv j
(merge_hs #_ #f olds hs)
(merge_hs #_ #f (mt_flush_to_olds #_ #f lv pi i j olds hs)
(mt_flush_to_ lv hs pi i j))
val mt_flush_to_inv_preserved:
#hsz:pos ->
mt:merkle_tree{mt_wf_elts mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
idx:nat{idx >= MT?.i mt /\ idx < MT?.j mt} ->
Lemma (requires (mt_inv mt olds))
(ensures (mt_inv (mt_flush_to mt idx)
(mt_flush_to_olds #_ #(MT?.hash_fun mt) 0 (MT?.i mt) idx (MT?.j mt) olds (MT?.hs mt))))
let mt_flush_to_inv_preserved #hsz mt olds idx =
mt_flush_to_inv_preserved_ #_ #(MT?.hash_fun mt) 0 (MT?.i mt) idx (MT?.j mt) olds (MT?.hs mt);
mt_flush_to_merge_preserved #_ #(MT?.hash_fun mt) 0 (MT?.i mt) idx (MT?.j mt) olds (MT?.hs mt)
val mt_flush_inv_preserved:
#hsz:pos ->
mt:merkle_tree #hsz {mt_wf_elts mt /\ MT?.j mt > MT?.i mt} ->
olds:hashess #hsz {S.length olds = 32 /\ mt_olds_inv #hsz 0 (MT?.i mt) olds} ->
Lemma (requires (mt_inv mt olds))
(ensures (mt_inv (mt_flush mt)
(mt_flush_to_olds #_ #(MT?.hash_fun mt)
0 (MT?.i mt) (MT?.j mt - 1) (MT?.j mt) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"MerkleTree.Spec.fst.checked",
"MerkleTree.New.High.Correct.Base.fst.checked",
"MerkleTree.New.High.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"EverCrypt.Helpers.fsti.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": false,
"source_file": "MerkleTree.New.High.Correct.Flushing.fst"
} | [
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High",
"short_module": null
},
{
"abbrev": true,
"full_module": "MerkleTree.Spec",
"short_module": "MTS"
},
{
"abbrev": true,
"full_module": "EverCrypt.Hash",
"short_module": "EHS"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "List"
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Classical",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt.Helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "MerkleTree.New.High.Correct",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
mt: MerkleTree.New.High.merkle_tree{MerkleTree.New.High.mt_wf_elts mt /\ MT?.j mt > MT?.i mt} ->
olds:
MerkleTree.New.High.hashess
{ FStar.Seq.Base.length olds = 32 /\
MerkleTree.New.High.Correct.Base.mt_olds_inv 0 (MT?.i mt) olds }
-> FStar.Pervasives.Lemma (requires MerkleTree.New.High.Correct.Base.mt_inv mt olds)
(ensures
MerkleTree.New.High.Correct.Base.mt_inv (MerkleTree.New.High.mt_flush mt)
(MerkleTree.New.High.Correct.Flushing.mt_flush_to_olds 0
(MT?.i mt)
(MT?.j mt - 1)
(MT?.j mt)
olds
(MT?.hs mt))) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.pos",
"MerkleTree.New.High.merkle_tree",
"Prims.l_and",
"MerkleTree.New.High.mt_wf_elts",
"Prims.b2t",
"Prims.op_GreaterThan",
"MerkleTree.New.High.__proj__MT__item__j",
"MerkleTree.New.High.__proj__MT__item__i",
"MerkleTree.New.High.hashess",
"Prims.op_Equality",
"Prims.int",
"FStar.Seq.Base.length",
"MerkleTree.New.High.hashes",
"MerkleTree.New.High.Correct.Base.mt_olds_inv",
"MerkleTree.New.High.Correct.Flushing.mt_flush_to_inv_preserved",
"Prims.op_Subtraction",
"Prims.unit"
] | [] | true | false | true | false | false | let mt_flush_inv_preserved #hsz mt olds =
| mt_flush_to_inv_preserved #hsz mt olds (MT?.j mt - 1) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse_list_tailrec_inv | val parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0 | val parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0 | let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input []) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 58,
"end_line": 136,
"start_col": 0,
"start_line": 122
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l' | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p32: LowParse.SLow.Base.parser32 p ->
input: LowParse.SLow.Base.bytes32 ->
b: Prims.bool ->
x: FStar.Pervasives.Native.option (LowParse.SLow.Base.bytes32 * Prims.list t)
-> Prims.GTot Type0 | Prims.GTot | [
"sometrivial"
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.SLow.Base.parser32",
"LowParse.SLow.Base.bytes32",
"Prims.bool",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"Prims.list",
"Prims.l_and",
"Prims.eq2",
"LowParse.SLow.List.parse_list_tailrec'",
"Prims.Nil",
"Prims.l_imp",
"Prims.int",
"FStar.Bytes.length",
"Prims.b2t",
"FStar.Pervasives.Native.uu___is_None"
] | [] | false | false | false | false | true | let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0 =
| match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None -> b == false /\ None? (parse_list_tailrec' p32 input []) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.list_append_rev_cons | val list_append_rev_cons (#t: Type) (v: t) (aux l: list t)
: Lemma (L.append (L.rev (v :: aux)) l == L.append (L.rev aux) (v :: l)) | val list_append_rev_cons (#t: Type) (v: t) (aux l: list t)
: Lemma (L.append (L.rev (v :: aux)) l == L.append (L.rev aux) (v :: l)) | let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 34,
"end_line": 42,
"start_col": 0,
"start_line": 35
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | v: t -> aux: Prims.list t -> l: Prims.list t
-> FStar.Pervasives.Lemma
(ensures FStar.List.Tot.Base.rev (v :: aux) @ l == FStar.List.Tot.Base.rev aux @ v :: l) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"Prims.list",
"FStar.List.Tot.Properties.append_assoc",
"FStar.List.Tot.Base.rev",
"Prims.Cons",
"Prims.Nil",
"Prims.unit",
"FStar.List.Tot.Properties.rev_rev'",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.List.Tot.Base.append",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let list_append_rev_cons (#t: Type) (v: t) (aux l: list t)
: Lemma (L.append (L.rev (v :: aux)) l == L.append (L.rev aux) (v :: l)) =
| L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse_list_tailrec_measure | val parse_list_tailrec_measure (#t: Type) (x: option (bytes32 * list t)) : GTot nat | val parse_list_tailrec_measure (#t: Type) (x: option (bytes32 * list t)) : GTot nat | let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input' | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 41,
"end_line": 144,
"start_col": 0,
"start_line": 138
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input []) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Pervasives.Native.option (LowParse.SLow.Base.bytes32 * Prims.list t)
-> Prims.GTot Prims.nat | Prims.GTot | [
"sometrivial"
] | [] | [
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.SLow.Base.bytes32",
"Prims.list",
"FStar.Bytes.length",
"Prims.nat"
] | [] | false | false | false | false | false | let parse_list_tailrec_measure (#t: Type) (x: option (bytes32 * list t)) : GTot nat =
| match x with
| None -> 0
| Some (input', _) -> B32.length input' | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse_list_tailrec | val parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) {res == parse_list_tailrec' p32 input []}) | val parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) {res == parse_list_tailrec' p32 input []}) | let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu') | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 44,
"end_line": 192,
"start_col": 0,
"start_line": 176
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p32: LowParse.SLow.Base.parser32 p -> input: LowParse.SLow.Base.bytes32
-> res:
FStar.Pervasives.Native.option (Prims.list t)
{res == LowParse.SLow.List.parse_list_tailrec' p32 input []} | Prims.Tot | [
"total"
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.SLow.Base.parser32",
"LowParse.SLow.Base.bytes32",
"FStar.Pervasives.Native.None",
"Prims.list",
"FStar.Pervasives.Native.Some",
"LowParse.SLow.List.list_rev",
"FStar.Pervasives.Native.option",
"Prims.eq2",
"LowParse.SLow.List.parse_list_tailrec'",
"Prims.Nil",
"FStar.Pervasives.Native.tuple2",
"C.Loops.total_while",
"LowParse.SLow.List.parse_list_tailrec_measure",
"LowParse.SLow.List.parse_list_tailrec_inv",
"LowParse.SLow.List.parse_list_tailrec_body",
"Prims.bool",
"FStar.Pervasives.Native.Mktuple2"
] | [] | false | false | false | false | false | let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) {res == parse_list_tailrec' p32 input []}) =
| let accu =
CL.total_while (parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu') | false |
LowParse.SLow.List.fst | LowParse.SLow.List.partial_serialize32_list'_init | val partial_serialize32_list'_init
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Lemma
(requires
(serialize_list_precond k /\ Seq.length (serialize (serialize_list p s) input) < 4294967296)
) (ensures (partial_serialize32_list'_inv p s s32 input true (B32.empty_bytes, input))) | val partial_serialize32_list'_init
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Lemma
(requires
(serialize_list_precond k /\ Seq.length (serialize (serialize_list p s) input) < 4294967296)
) (ensures (partial_serialize32_list'_inv p s s32 input true (B32.empty_bytes, input))) | let partial_serialize32_list'_init
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Lemma
(requires (
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296
))
(ensures (
partial_serialize32_list'_inv p s s32 input true (B32.empty_bytes, input)
))
= assert (Seq.equal (B32.reveal B32.empty_bytes) Seq.empty);
Seq.append_empty_l (B32.reveal (partial_serialize32_list' p s s32 input));
assert (B32.reveal (partial_serialize32_list' p s s32 input) == B32.reveal (partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input));
assert (serializer32_correct (serialize_list p s) input (partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input)) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 124,
"end_line": 342,
"start_col": 0,
"start_line": 324
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu')
inline_for_extraction
let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } ))
let rec partial_serialize32_list'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
serializer32_correct (serialize_list p s) input res
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
let res = B32.empty_bytes in
assert (Seq.equal (B32.reveal res) (Seq.empty));
res
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let sq = partial_serialize32_list' p s s32 q in
let res = B32.append sa sq in
res
let rec partial_serialize32_list_tailrec'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(accu: bytes32)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
B32.length accu + Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
B32.reveal res == Seq.append (B32.reveal accu) (B32.reveal (partial_serialize32_list' p s s32 input))
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
Seq.append_empty_r (B32.reveal accu);
accu
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let accu' = B32.append accu sa in
Seq.append_assoc (B32.reveal accu) (B32.reveal sa) (B32.reveal (partial_serialize32_list' p s s32 q));
partial_serialize32_list_tailrec' p s s32 accu' q
let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0
= serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\ (
let (accu, input') = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct
(serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)
)
let partial_serialize32_list'_measure
(#t: Type)
(x: bytes32 * list t)
: GTot nat
= L.length (snd x)
inline_for_extraction
let partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: (x: (bytes32 * list t)) ->
Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures (fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==> partial_serialize32_list'_measure y < partial_serialize32_list'_measure x)
))
= fun (x: bytes32 * list t) ->
let (accu, input') = x in
match input' with
| [] -> (false, x)
| a :: q ->
[@inline_let]
let _ = serialize_list_cons p s a q in
let sa = s32 a in
let accu' = B32.append accu sa in
(true, (accu', q)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: LowParse.Spec.Base.parser k t ->
s: LowParse.Spec.Base.serializer p ->
s32: LowParse.SLow.Base.partial_serializer32 s ->
input: Prims.list t
-> FStar.Pervasives.Lemma
(requires
LowParse.Spec.List.serialize_list_precond k /\
FStar.Seq.Base.length (LowParse.Spec.Base.serialize (LowParse.Spec.List.serialize_list p s)
input) <
4294967296)
(ensures
LowParse.SLow.List.partial_serialize32_list'_inv p
s
s32
input
true
(FStar.Bytes.empty_bytes,
input)) | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.SLow.Base.partial_serializer32",
"Prims.list",
"Prims._assert",
"LowParse.SLow.Base.serializer32_correct",
"LowParse.Spec.List.parse_list_kind",
"LowParse.Spec.List.parse_list",
"LowParse.Spec.List.serialize_list",
"LowParse.SLow.List.partial_serialize32_list_tailrec'",
"FStar.Bytes.empty_bytes",
"Prims.unit",
"Prims.eq2",
"FStar.Seq.Base.seq",
"FStar.Bytes.byte",
"FStar.Bytes.reveal",
"LowParse.SLow.List.partial_serialize32_list'",
"FStar.Seq.Base.append_empty_l",
"FStar.Seq.Base.equal",
"FStar.Seq.Base.empty",
"Prims.l_and",
"Prims.b2t",
"LowParse.Spec.List.serialize_list_precond",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"Prims.squash",
"LowParse.SLow.List.partial_serialize32_list'_inv",
"FStar.Pervasives.Native.Mktuple2",
"LowParse.SLow.Base.bytes32",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | true | false | true | false | false | let partial_serialize32_list'_init
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Lemma
(requires
(serialize_list_precond k /\ Seq.length (serialize (serialize_list p s) input) < 4294967296)
) (ensures (partial_serialize32_list'_inv p s s32 input true (B32.empty_bytes, input))) =
| assert (Seq.equal (B32.reveal B32.empty_bytes) Seq.empty);
Seq.append_empty_l (B32.reveal (partial_serialize32_list' p s s32 input));
assert (B32.reveal (partial_serialize32_list' p s s32 input) ==
B32.reveal (partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input));
assert (serializer32_correct (serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 B32.empty_bytes input)) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse_list_tailrec' | val parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t)) (decreases (B32.length b)) | val parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t)) (decreases (B32.length b)) | let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 63,
"end_line": 33,
"start_col": 0,
"start_line": 13
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p32: LowParse.SLow.Base.parser32 p -> b: LowParse.SLow.Base.bytes32 -> aux: Prims.list t
-> Prims.GTot (FStar.Pervasives.Native.option (Prims.list t)) | Prims.GTot | [
"sometrivial",
""
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.SLow.Base.parser32",
"LowParse.SLow.Base.bytes32",
"Prims.list",
"Prims.op_Equality",
"FStar.UInt32.t",
"FStar.Bytes.len",
"FStar.UInt32.__uint_to_t",
"FStar.Pervasives.Native.Some",
"FStar.List.Tot.Base.rev",
"Prims.bool",
"FStar.Pervasives.Native.None",
"LowParse.SLow.List.parse_list_tailrec'",
"FStar.Bytes.slice",
"Prims.Cons",
"FStar.Pervasives.Native.option",
"Prims.unit",
"LowParse.Spec.List.parse_list_eq",
"FStar.Bytes.reveal"
] | [
"recursion"
] | false | false | false | false | false | let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t)) (decreases (B32.length b)) =
| parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul then None else parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse32_list | val parse32_list (#k: parser_kind) (#t: Type) (#p: parser k t) (p32: parser32 p)
: Tot (parser32 (parse_list p)) | val parse32_list (#k: parser_kind) (#t: Type) (#p: parser k t) (p32: parser32 p)
: Tot (parser32 (parse_list p)) | let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } )) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 85,
"end_line": 208,
"start_col": 0,
"start_line": 195
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu') | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | p32: LowParse.SLow.Base.parser32 p -> LowParse.SLow.Base.parser32 (LowParse.Spec.List.parse_list p) | Prims.Tot | [
"total"
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.SLow.Base.parser32",
"LowParse.SLow.Base.bytes32",
"LowParse.SLow.List.parse_list_tailrec",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.tuple2",
"Prims.list",
"FStar.UInt32.t",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Bytes.len",
"FStar.Pervasives.Native.option",
"LowParse.SLow.Base.parser32_correct",
"LowParse.Spec.List.parse_list_kind",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Spec.Base.parser_kind_prop_equiv",
"LowParse.SLow.List.parse_list_tailrec'_correct"
] | [] | false | false | false | false | false | let parse32_list (#k: parser_kind) (#t: Type) (#p: parser k t) (p32: parser32 p)
: Tot (parser32 (parse_list p)) =
| fun (input: bytes32) ->
((parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res -> Some (res, B32.len input))
<:
(res: option (list t * U32.t) {parser32_correct (parse_list p) input res})) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.partial_serialize32_list'_inv | val partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: (bytes32 * list t))
: GTot Type0 | val partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: (bytes32 * list t))
: GTot Type0 | let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0
= serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\ (
let (accu, input') = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct
(serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)
) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 3,
"end_line": 290,
"start_col": 0,
"start_line": 271
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu')
inline_for_extraction
let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } ))
let rec partial_serialize32_list'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
serializer32_correct (serialize_list p s) input res
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
let res = B32.empty_bytes in
assert (Seq.equal (B32.reveal res) (Seq.empty));
res
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let sq = partial_serialize32_list' p s s32 q in
let res = B32.append sa sq in
res
let rec partial_serialize32_list_tailrec'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(accu: bytes32)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
B32.length accu + Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
B32.reveal res == Seq.append (B32.reveal accu) (B32.reveal (partial_serialize32_list' p s s32 input))
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
Seq.append_empty_r (B32.reveal accu);
accu
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let accu' = B32.append accu sa in
Seq.append_assoc (B32.reveal accu) (B32.reveal sa) (B32.reveal (partial_serialize32_list' p s s32 q));
partial_serialize32_list_tailrec' p s s32 accu' q | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: LowParse.Spec.Base.parser k t ->
s: LowParse.Spec.Base.serializer p ->
s32: LowParse.SLow.Base.partial_serializer32 s ->
input: Prims.list t ->
continue: Prims.bool ->
x: (LowParse.SLow.Base.bytes32 * Prims.list t)
-> Prims.GTot Type0 | Prims.GTot | [
"sometrivial"
] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.SLow.Base.partial_serializer32",
"Prims.list",
"Prims.bool",
"FStar.Pervasives.Native.tuple2",
"LowParse.SLow.Base.bytes32",
"Prims.l_and",
"Prims.b2t",
"LowParse.Spec.List.serialize_list_precond",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.List.parse_list_kind",
"LowParse.Spec.List.parse_list",
"LowParse.Spec.List.serialize_list",
"Prims.op_Addition",
"FStar.Bytes.length",
"LowParse.SLow.Base.serializer32_correct",
"LowParse.SLow.List.partial_serialize32_list_tailrec'",
"Prims.l_imp",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.logical"
] | [] | false | false | false | false | true | let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0 =
| serialize_list_precond k /\ Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
(let accu, input' = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct (serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.parse_list_tailrec_body | val parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(x: option (bytes32 * list t))
: Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures
(fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
)) | val parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(x: option (bytes32 * list t))
: Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures
(fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
)) | let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 27,
"end_line": 173,
"start_col": 0,
"start_line": 147
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input' | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p32: LowParse.SLow.Base.parser32 p ->
input: LowParse.SLow.Base.bytes32 ->
x: FStar.Pervasives.Native.option (LowParse.SLow.Base.bytes32 * Prims.list t)
-> Prims.Pure
(Prims.bool * FStar.Pervasives.Native.option (LowParse.SLow.Base.bytes32 * Prims.list t)) | Prims.Pure | [] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.SLow.Base.parser32",
"LowParse.SLow.Base.bytes32",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"Prims.list",
"Prims.op_Equality",
"FStar.UInt32.t",
"FStar.UInt32.__uint_to_t",
"FStar.Pervasives.Native.Mktuple2",
"Prims.bool",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.Some",
"Prims.Cons",
"FStar.Bytes.bytes",
"Prims.eq2",
"FStar.Seq.Base.seq",
"FStar.UInt8.t",
"FStar.Bytes.reveal",
"FStar.Seq.Base.slice",
"FStar.UInt32.v",
"FStar.Bytes.slice",
"FStar.Bytes.len",
"LowParse.SLow.List.parse_list_tailrec_inv",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"LowParse.SLow.List.parse_list_tailrec_measure",
"Prims.l_True",
"Prims.logical"
] | [] | false | false | false | false | false | let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(x: option (bytes32 * list t))
: Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures
(fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue
then parse_list_tailrec_measure y < parse_list_tailrec_measure x
else True))) =
| fun (x: option (bytes32 * list t)) ->
let Some (input', accu') = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None) | false |
LowParse.SLow.List.fst | LowParse.SLow.List.list_rev | val list_rev (#t: Type) (l: list t) : Tot (l': list t {l' == L.rev l}) | val list_rev (#t: Type) (l: list t) : Tot (l': list t {l' == L.rev l}) | let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l' | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 6,
"end_line": 120,
"start_col": 0,
"start_line": 102
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == []) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | l: Prims.list t -> l': Prims.list t {l' == FStar.List.Tot.Base.rev l} | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Prims.Nil",
"Prims.eq2",
"FStar.List.Tot.Base.rev",
"FStar.Pervasives.Native.tuple2",
"C.Loops.total_while",
"FStar.List.Tot.Base.length",
"Prims.nat",
"LowParse.SLow.List.list_rev_inv",
"FStar.Pervasives.Native.Mktuple2",
"Prims.bool",
"Prims.Cons"
] | [] | false | false | false | false | false | let list_rev (#t: Type) (l: list t) : Tot (l': list t {l' == L.rev l}) =
| match l with
| [] -> []
| _ ->
let _, l' =
CL.total_while (fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc)))
(l, [])
in
l' | false |
LowParse.SLow.List.fst | LowParse.SLow.List.partial_serialize32_list'_body | val partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(x: (bytes32 * list t))
: Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures
(fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==>
partial_serialize32_list'_measure y < partial_serialize32_list'_measure x))) | val partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(x: (bytes32 * list t))
: Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures
(fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==>
partial_serialize32_list'_measure y < partial_serialize32_list'_measure x))) | let partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: (x: (bytes32 * list t)) ->
Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures (fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==> partial_serialize32_list'_measure y < partial_serialize32_list'_measure x)
))
= fun (x: bytes32 * list t) ->
let (accu, input') = x in
match input' with
| [] -> (false, x)
| a :: q ->
[@inline_let]
let _ = serialize_list_cons p s a q in
let sa = s32 a in
let accu' = B32.append accu sa in
(true, (accu', q)) | {
"file_name": "src/lowparse/LowParse.SLow.List.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 22,
"end_line": 322,
"start_col": 0,
"start_line": 299
} | module LowParse.SLow.List
include LowParse.Spec.List
include LowParse.SLow.Combinators
module B32 = FStar.Bytes
module U32 = FStar.UInt32
module CL = C.Loops
#set-options "--z3rlimit 16 --max_fuel 8 --max_ifuel 8"
module L = FStar.List.Tot
let rec parse_list_tailrec'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: GTot (option (list t))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
Some (L.rev aux)
else
match p32 b with
| None -> None
| Some (v, n) ->
if n = 0ul
then None (* elements cannot be empty *)
else
parse_list_tailrec' p32 (B32.slice b n (B32.len b)) (v :: aux)
let list_append_rev_cons
(#t: Type)
(v: t)
(aux l: list t)
: Lemma (L.append (L.rev (v ::aux)) l == L.append (L.rev aux) (v :: l))
= L.rev_rev' (v :: aux);
L.rev_rev' aux;
L.append_assoc (L.rev aux) [v] l
let rec parse_list_tailrec'_correct'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
(aux: list t)
: Lemma
(requires True)
(ensures (
parse_list_tailrec' p32 b aux == (
match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> Some (L.append (L.rev aux) l)
| None -> None
)))
(decreases (B32.length b))
= parse_list_eq p (B32.reveal b);
if B32.len b = 0ul
then
L.append_l_nil (L.rev aux)
else
match p32 b with
| None -> ()
| Some (v, n) ->
if n = 0ul
then ()
else begin
let s = B32.slice b n (B32.len b) in
parse_list_tailrec'_correct' p32 s (v :: aux);
match parse (parse_list p) (B32.reveal s) with
| Some (l, n') ->
list_append_rev_cons v aux l
| None -> ()
end
let parse_list_tailrec'_correct
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(b: bytes32)
: Lemma
begin match parse (parse_list p) (B32.reveal b) with
| Some (l, n) -> parse_list_tailrec' p32 b [] == Some l
| None -> parse_list_tailrec' p32 b [] == None
end
= parse_list_tailrec'_correct' p32 b []
let list_rev_inv
(#t: Type)
(l: list t)
(b: bool)
(x: list t * list t)
: GTot Type0
= let (rem, acc) = x in
L.rev l == L.rev_acc rem acc /\
(b == false ==> rem == [])
let list_rev
(#t: Type)
(l: list t)
: Tot (l' : list t { l' == L.rev l } )
= match l with
| [] -> []
| _ ->
let (_, l') =
CL.total_while
(fun (rem, _) -> L.length rem)
(list_rev_inv l)
(fun (rem, acc) ->
match rem with
| [] -> (false, (rem, acc))
| a :: q -> (true, (q, a :: acc))
)
(l, [])
in
l'
let parse_list_tailrec_inv
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
(b: bool)
(x: option (bytes32 * list t))
: GTot Type0
= match x with
| Some (input', accu') ->
parse_list_tailrec' p32 input [] == parse_list_tailrec' p32 input' accu' /\
(b == false ==> B32.length input' == 0)
| None ->
b == false /\ None? (parse_list_tailrec' p32 input [])
let parse_list_tailrec_measure
(#t: Type)
(x: option (bytes32 * list t))
: GTot nat
= match x with
| None -> 0
| Some (input', _) -> B32.length input'
inline_for_extraction
let parse_list_tailrec_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: (x: option (bytes32 * list t)) ->
Pure (bool * option (bytes32 * list t))
(requires (parse_list_tailrec_inv p32 input true x))
(ensures (fun (continue, y) ->
parse_list_tailrec_inv p32 input continue y /\
(if continue then parse_list_tailrec_measure y < parse_list_tailrec_measure x else True)
))
= fun (x: option (bytes32 * list t)) ->
let (Some (input', accu')) = x in
let len = B32.len input' in
if len = 0ul
then (false, x)
else
match p32 input' with
| Some (v, consumed) ->
if consumed = 0ul
then (false, None)
else
let input'' = B32.slice input' consumed len in
(true, Some (input'', v :: accu'))
| None -> (false, None)
inline_for_extraction
let parse_list_tailrec
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
(input: bytes32)
: Tot (res: option (list t) { res == parse_list_tailrec' p32 input [] } )
= let accu =
CL.total_while
(parse_list_tailrec_measure #t)
(parse_list_tailrec_inv p32 input)
(fun x -> parse_list_tailrec_body p32 input x)
(Some (input, []))
in
match accu with
| None -> None
| Some (_, accu') -> Some (list_rev accu')
inline_for_extraction
let parse32_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(p32: parser32 p)
: Tot (parser32 (parse_list p))
= fun (input: bytes32) -> ((
parse_list_tailrec'_correct p32 input;
parser_kind_prop_equiv parse_list_kind (parse_list p);
match parse_list_tailrec p32 input with
| None -> None
| Some res ->
Some (res, B32.len input)
) <: (res: option (list t * U32.t) { parser32_correct (parse_list p) input res } ))
let rec partial_serialize32_list'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
serializer32_correct (serialize_list p s) input res
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
let res = B32.empty_bytes in
assert (Seq.equal (B32.reveal res) (Seq.empty));
res
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let sq = partial_serialize32_list' p s s32 q in
let res = B32.append sa sq in
res
let rec partial_serialize32_list_tailrec'
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(accu: bytes32)
(input: list t)
: Ghost bytes32
(requires (
serialize_list_precond k /\ (
B32.length accu + Seq.length (serialize (serialize_list p s) input) < 4294967296
)))
(ensures (fun (res: bytes32) ->
serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\
B32.reveal res == Seq.append (B32.reveal accu) (B32.reveal (partial_serialize32_list' p s s32 input))
))
(decreases input)
= match input with
| [] ->
serialize_list_nil p s;
Seq.append_empty_r (B32.reveal accu);
accu
| a :: q ->
serialize_list_cons p s a q;
let sa = s32 a in
let accu' = B32.append accu sa in
Seq.append_assoc (B32.reveal accu) (B32.reveal sa) (B32.reveal (partial_serialize32_list' p s s32 q));
partial_serialize32_list_tailrec' p s s32 accu' q
let partial_serialize32_list'_inv
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(continue: bool)
(x: bytes32 * list t)
: GTot Type0
= serialize_list_precond k /\
Seq.length (serialize (serialize_list p s) input) < 4294967296 /\ (
let (accu, input') = x in
B32.length accu + Seq.length (serialize (serialize_list p s) input') < 4294967296 /\
serializer32_correct
(serialize_list p s)
input
(partial_serialize32_list_tailrec' p s s32 accu input') /\
(continue == false ==> L.length input' == 0)
)
let partial_serialize32_list'_measure
(#t: Type)
(x: bytes32 * list t)
: GTot nat
= L.length (snd x) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.SLow.Combinators.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Bytes.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.SLow.List.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Bytes",
"short_module": "B32"
},
{
"abbrev": false,
"full_module": "LowParse.SLow.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.SLow",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 8,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
p: LowParse.Spec.Base.parser k t ->
s: LowParse.Spec.Base.serializer p ->
s32: LowParse.SLow.Base.partial_serializer32 s ->
input: Prims.list t ->
x: (LowParse.SLow.Base.bytes32 * Prims.list t)
-> Prims.Pure (Prims.bool * (LowParse.SLow.Base.bytes32 * Prims.list t)) | Prims.Pure | [] | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.SLow.Base.partial_serializer32",
"Prims.list",
"FStar.Pervasives.Native.tuple2",
"LowParse.SLow.Base.bytes32",
"FStar.Pervasives.Native.Mktuple2",
"Prims.bool",
"FStar.Bytes.bytes",
"FStar.Bytes.append",
"LowParse.SLow.Base.serializer32_correct",
"Prims.unit",
"LowParse.Spec.List.serialize_list_cons",
"LowParse.SLow.List.partial_serialize32_list'_inv",
"Prims.l_and",
"Prims.l_imp",
"Prims.eq2",
"Prims.b2t",
"Prims.op_LessThan",
"LowParse.SLow.List.partial_serialize32_list'_measure"
] | [] | false | false | false | false | false | let partial_serialize32_list'_body
(#t: Type)
(#k: parser_kind)
(p: parser k t)
(s: serializer p)
(s32: partial_serializer32 s)
(input: list t)
(x: (bytes32 * list t))
: Pure (bool * (bytes32 * list t))
(requires (partial_serialize32_list'_inv p s s32 input true x))
(ensures
(fun (continue, y) ->
partial_serialize32_list'_inv p s s32 input continue y /\
(continue == true ==>
partial_serialize32_list'_measure y < partial_serialize32_list'_measure x))) =
| fun (x: bytes32 * list t) ->
let accu, input' = x in
match input' with
| [] -> (false, x)
| a :: q ->
[@@ inline_let ]let _ = serialize_list_cons p s a q in
let sa = s32 a in
let accu' = B32.append accu sa in
(true, (accu', q)) | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.