effect
stringclasses 48
values | original_source_type
stringlengths 0
23k
| opens_and_abbrevs
listlengths 2
92
| isa_cross_project_example
bool 1
class | source_definition
stringlengths 9
57.9k
| partial_definition
stringlengths 7
23.3k
| is_div
bool 2
classes | is_type
null | is_proof
bool 2
classes | completed_definiton
stringlengths 1
250k
| dependencies
dict | effect_flags
sequencelengths 0
2
| ideal_premises
sequencelengths 0
236
| mutual_with
sequencelengths 0
11
| file_context
stringlengths 0
407k
| interleaved
bool 1
class | is_simply_typed
bool 2
classes | file_name
stringlengths 5
48
| vconfig
dict | is_simple_lemma
null | source_type
stringlengths 10
23k
| proof_features
sequencelengths 0
1
| name
stringlengths 8
95
| source
dict | verbose_type
stringlengths 1
7.42k
| source_range
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Prims.Tot | val movbe_post:VSig.vale_post dom | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f | val movbe_post:VSig.vale_post dom
let movbe_post:VSig.vale_post dom = | false | null | false | fun (c: V.va_code) (va_s0: V.va_state) (va_s1: V.va_state) (f: V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_fuel",
"Vale.Lib.X64.Cpuidstdcall.va_ens_Check_movbe_stdcall",
"Vale.Interop.Assumptions.win",
"Prims.prop"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val movbe_post:VSig.vale_post dom | [] | Vale.Stdcalls.X64.Cpuid.movbe_post | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_post Vale.Stdcalls.X64.Cpuid.dom | {
"end_col": 58,
"end_line": 284,
"start_col": 2,
"start_line": 280
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win | let code_avx512 = | false | null | false | VC.va_code_Check_avx512_stdcall IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Lib.X64.Cpuidstdcall.va_code_Check_avx512_stdcall",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma' | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val code_avx512 : Vale.X64.Decls.va_code | [] | Vale.Stdcalls.X64.Cpuid.code_avx512 | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.Decls.va_code | {
"end_col": 56,
"end_line": 450,
"start_col": 18,
"start_line": 450
} |
|
Prims.Tot | val rdrand_post:VSig.vale_post dom | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f | val rdrand_post:VSig.vale_post dom
let rdrand_post:VSig.vale_post dom = | false | null | false | fun (c: V.va_code) (va_s0: V.va_state) (va_s1: V.va_state) (f: V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_fuel",
"Vale.Lib.X64.Cpuidstdcall.va_ens_Check_rdrand_stdcall",
"Vale.Interop.Assumptions.win",
"Prims.prop"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rdrand_post:VSig.vale_post dom | [] | Vale.Stdcalls.X64.Cpuid.rdrand_post | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_post Vale.Stdcalls.X64.Cpuid.dom | {
"end_col": 59,
"end_line": 380,
"start_col": 2,
"start_line": 376
} |
Prims.Tot | val avx512_post:VSig.vale_post dom | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f | val avx512_post:VSig.vale_post dom
let avx512_post:VSig.vale_post dom = | false | null | false | fun (c: V.va_code) (va_s0: V.va_state) (va_s1: V.va_state) (f: V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_fuel",
"Vale.Lib.X64.Cpuidstdcall.va_ens_Check_avx512_stdcall",
"Vale.Interop.Assumptions.win",
"Prims.prop"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_post:VSig.vale_post dom | [] | Vale.Stdcalls.X64.Cpuid.avx512_post | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_post Vale.Stdcalls.X64.Cpuid.dom | {
"end_col": 59,
"end_line": 428,
"start_col": 2,
"start_line": 424
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win | let code_osxsave = | false | null | false | VC.va_code_Check_osxsave_stdcall IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Lib.X64.Cpuidstdcall.va_code_Check_osxsave_stdcall",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma' | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val code_osxsave : Vale.X64.Decls.va_code | [] | Vale.Stdcalls.X64.Cpuid.code_osxsave | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.Decls.va_code | {
"end_col": 58,
"end_line": 498,
"start_col": 19,
"start_line": 498
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win | let code_avx_xcr0 = | false | null | false | VC.va_code_Check_avx_xcr0_stdcall IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Lib.X64.Cpuidstdcall.va_code_Check_avx_xcr0_stdcall",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma' | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val code_avx_xcr0 : Vale.X64.Decls.va_code | [] | Vale.Stdcalls.X64.Cpuid.code_avx_xcr0 | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.X64.Decls.va_code | {
"end_col": 60,
"end_line": 546,
"start_col": 20,
"start_line": 546
} |
|
Prims.Tot | val avx512_xcr0_pre:VSig.vale_pre dom | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_xcr0_stdcall c va_s0 IA.win | val avx512_xcr0_pre:VSig.vale_pre dom
let avx512_xcr0_pre:VSig.vale_pre dom = | false | null | false | fun (c: V.va_code) (va_s0: V.va_state) -> VC.va_req_Check_avx512_xcr0_stdcall c va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_req_Check_avx512_xcr0_stdcall",
"Vale.Interop.Assumptions.win",
"Prims.prop"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma'
noextract
let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx_xcr0 wrapper *)
[@__reduce__] noextract
let lowstar_avx_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_xcr0_pre:VSig.vale_pre dom | [] | Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_pre Vale.Stdcalls.X64.Cpuid.dom | {
"end_col": 56,
"end_line": 564,
"start_col": 2,
"start_line": 562
} |
Prims.Tot | val as_normal_t (#a: Type) (x: a) : normal a | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let as_normal_t (#a:Type) (x:a) : normal a = x | val as_normal_t (#a: Type) (x: a) : normal a
let as_normal_t (#a: Type) (x: a) : normal a = | false | null | false | x | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.Base.normal"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val as_normal_t (#a: Type) (x: a) : normal a | [] | Vale.Stdcalls.X64.Cpuid.as_normal_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: a -> Vale.Interop.Base.normal a | {
"end_col": 46,
"end_line": 19,
"start_col": 45,
"start_line": 19
} |
Prims.Tot | val as_t (#a: Type) (x: normal a) : a | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let as_t (#a:Type) (x:normal a) : a = x | val as_t (#a: Type) (x: normal a) : a
let as_t (#a: Type) (x: normal a) : a = | false | null | false | x | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.Base.normal"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *) | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val as_t (#a: Type) (x: normal a) : a | [] | Vale.Stdcalls.X64.Cpuid.as_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.Interop.Base.normal a -> a | {
"end_col": 39,
"end_line": 17,
"start_col": 38,
"start_line": 17
} |
Prims.Tot | val dom:IX64.arity_ok_stdcall td | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let dom: IX64.arity_ok_stdcall td = [] | val dom:IX64.arity_ok_stdcall td
let dom:IX64.arity_ok_stdcall td = | false | null | false | [] | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Prims.Nil",
"Vale.Interop.Base.td"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val dom:IX64.arity_ok_stdcall td | [] | Vale.Stdcalls.X64.Cpuid.dom | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.Interop.X64.arity_ok_stdcall Vale.Interop.Base.td | {
"end_col": 38,
"end_line": 22,
"start_col": 36,
"start_line": 22
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma' | let adx_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.adx_pre",
"Vale.Stdcalls.X64.Cpuid.adx_post",
"Vale.Stdcalls.X64.Cpuid.adx_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val adx_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.adx_pre
Vale.Stdcalls.X64.Cpuid.adx_post | [] | Vale.Stdcalls.X64.Cpuid.adx_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.adx_pre
Vale.Stdcalls.X64.Cpuid.adx_post | {
"end_col": 73,
"end_line": 160,
"start_col": 16,
"start_line": 160
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma' | let sse_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.sse_pre",
"Vale.Stdcalls.X64.Cpuid.sse_post",
"Vale.Stdcalls.X64.Cpuid.sse_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val sse_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.sse_pre
Vale.Stdcalls.X64.Cpuid.sse_post | [] | Vale.Stdcalls.X64.Cpuid.sse_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.sse_pre
Vale.Stdcalls.X64.Cpuid.sse_post | {
"end_col": 73,
"end_line": 352,
"start_col": 16,
"start_line": 352
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win)) | let lowstar_rdrand_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_rdrand",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.rdrand_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.rdrand_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.rdrand_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_rdrand_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_rdrand_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 74,
"end_line": 413,
"start_col": 2,
"start_line": 407
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win)) | let lowstar_avx2_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_avx2",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx2_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.avx2_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx2_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_avx2_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_avx2_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 68,
"end_line": 269,
"start_col": 2,
"start_line": 263
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma' | let aesni_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.aesni_pre",
"Vale.Stdcalls.X64.Cpuid.aesni_post",
"Vale.Stdcalls.X64.Cpuid.aesni_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val aesni_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.aesni_pre
Vale.Stdcalls.X64.Cpuid.aesni_post | [] | Vale.Stdcalls.X64.Cpuid.aesni_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.aesni_pre
Vale.Stdcalls.X64.Cpuid.aesni_post | {
"end_col": 81,
"end_line": 57,
"start_col": 18,
"start_line": 57
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win)) | let lowstar_aesni_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_aesni",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.aesni_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.aesni_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.aesni_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_aesni_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_aesni_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 71,
"end_line": 70,
"start_col": 2,
"start_line": 64
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win)) | let lowstar_sha_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_sha",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.sha_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.sha_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.sha_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_sha_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_sha_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 65,
"end_line": 124,
"start_col": 2,
"start_line": 118
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma' | let avx2_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.avx2_pre",
"Vale.Stdcalls.X64.Cpuid.avx2_post",
"Vale.Stdcalls.X64.Cpuid.avx2_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx2_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx2_pre
Vale.Stdcalls.X64.Cpuid.avx2_post | [] | Vale.Stdcalls.X64.Cpuid.avx2_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx2_pre
Vale.Stdcalls.X64.Cpuid.avx2_post | {
"end_col": 77,
"end_line": 256,
"start_col": 17,
"start_line": 256
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma' | let movbe_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.movbe_pre",
"Vale.Stdcalls.X64.Cpuid.movbe_post",
"Vale.Stdcalls.X64.Cpuid.movbe_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val movbe_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.movbe_pre
Vale.Stdcalls.X64.Cpuid.movbe_post | [] | Vale.Stdcalls.X64.Cpuid.movbe_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.movbe_pre
Vale.Stdcalls.X64.Cpuid.movbe_post | {
"end_col": 81,
"end_line": 304,
"start_col": 18,
"start_line": 304
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win)) | let lowstar_sse_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_sse",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.sse_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.sse_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.sse_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_sse_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_sse_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 65,
"end_line": 365,
"start_col": 2,
"start_line": 359
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_avx_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win)) | let lowstar_avx_xcr0_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_avx_xcr0",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma'
noextract
let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx_xcr0 wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_avx_xcr0_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_avx_xcr0_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 80,
"end_line": 557,
"start_col": 2,
"start_line": 551
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win)) | let lowstar_avx_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_avx",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.avx_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_avx_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_avx_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 65,
"end_line": 221,
"start_col": 2,
"start_line": 215
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win)) | let lowstar_movbe_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_movbe",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.movbe_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.movbe_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.movbe_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_movbe_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_movbe_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 71,
"end_line": 317,
"start_col": 2,
"start_line": 311
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma' | let avx512_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.avx512_pre",
"Vale.Stdcalls.X64.Cpuid.avx512_post",
"Vale.Stdcalls.X64.Cpuid.avx512_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx512_pre
Vale.Stdcalls.X64.Cpuid.avx512_post | [] | Vale.Stdcalls.X64.Cpuid.avx512_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx512_pre
Vale.Stdcalls.X64.Cpuid.avx512_post | {
"end_col": 85,
"end_line": 448,
"start_col": 19,
"start_line": 448
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win)) | let lowstar_adx_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_adx",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.adx_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.adx_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.adx_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_adx_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_adx_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 65,
"end_line": 173,
"start_col": 2,
"start_line": 167
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win)) | let lowstar_avx512_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_avx512",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.avx512_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_avx512_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_avx512_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 74,
"end_line": 461,
"start_col": 2,
"start_line": 455
} |
|
Prims.Ghost | val aesni_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires aesni_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f)) | [
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win | val aesni_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires aesni_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
let aesni_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires aesni_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_aesni_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.aesni_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.aesni_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val aesni_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires aesni_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.aesni_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 52,
"end_line": 53,
"start_col": 3,
"start_line": 53
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma' | let rdrand_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.rdrand_pre",
"Vale.Stdcalls.X64.Cpuid.rdrand_post",
"Vale.Stdcalls.X64.Cpuid.rdrand_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rdrand_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.rdrand_pre
Vale.Stdcalls.X64.Cpuid.rdrand_post | [] | Vale.Stdcalls.X64.Cpuid.rdrand_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.rdrand_pre
Vale.Stdcalls.X64.Cpuid.rdrand_post | {
"end_col": 85,
"end_line": 400,
"start_col": 19,
"start_line": 400
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma' | let sha_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.sha_pre",
"Vale.Stdcalls.X64.Cpuid.sha_post",
"Vale.Stdcalls.X64.Cpuid.sha_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val sha_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.sha_pre
Vale.Stdcalls.X64.Cpuid.sha_post | [] | Vale.Stdcalls.X64.Cpuid.sha_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.sha_pre
Vale.Stdcalls.X64.Cpuid.sha_post | {
"end_col": 73,
"end_line": 111,
"start_col": 16,
"start_line": 111
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma' | let avx_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.avx_pre",
"Vale.Stdcalls.X64.Cpuid.avx_post",
"Vale.Stdcalls.X64.Cpuid.avx_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx_pre
Vale.Stdcalls.X64.Cpuid.avx_post | [] | Vale.Stdcalls.X64.Cpuid.avx_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx_pre
Vale.Stdcalls.X64.Cpuid.avx_post | {
"end_col": 73,
"end_line": 208,
"start_col": 16,
"start_line": 208
} |
|
Prims.Ghost | val sha_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sha_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win | val sha_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sha_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
let sha_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sha_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_sha_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_sha_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.sha_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.sha_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val sha_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sha_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.sha_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 50,
"end_line": 107,
"start_col": 3,
"start_line": 107
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma' | let avx_xcr0_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_pre",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_post",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx_xcr0_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx_xcr0_pre
Vale.Stdcalls.X64.Cpuid.avx_xcr0_post | [] | Vale.Stdcalls.X64.Cpuid.avx_xcr0_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx_xcr0_pre
Vale.Stdcalls.X64.Cpuid.avx_xcr0_post | {
"end_col": 93,
"end_line": 544,
"start_col": 21,
"start_line": 544
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win)) | let lowstar_osxsave_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_osxsave",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.osxsave_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.osxsave_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.osxsave_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_osxsave_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_osxsave_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 77,
"end_line": 509,
"start_col": 2,
"start_line": 503
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma' | let osxsave_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.osxsave_pre",
"Vale.Stdcalls.X64.Cpuid.osxsave_post",
"Vale.Stdcalls.X64.Cpuid.osxsave_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val osxsave_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.osxsave_pre
Vale.Stdcalls.X64.Cpuid.osxsave_post | [] | Vale.Stdcalls.X64.Cpuid.osxsave_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.osxsave_pre
Vale.Stdcalls.X64.Cpuid.osxsave_post | {
"end_col": 89,
"end_line": 496,
"start_col": 20,
"start_line": 496
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lowstar_avx512_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512_xcr0
dom
[]
_
_
(W.mk_prediction code_avx512_xcr0 dom [] (avx512_xcr0_lemma code_avx512_xcr0 IA.win)) | let lowstar_avx512_xcr0_t = | false | null | false | IX64.as_lowstar_sig_t_weak_stdcall code_avx512_xcr0
dom
[]
_
_
(W.mk_prediction code_avx512_xcr0 dom [] (avx512_xcr0_lemma code_avx512_xcr0 IA.win)) | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Interop.X64.as_lowstar_sig_t_weak_stdcall",
"Vale.Stdcalls.X64.Cpuid.code_avx512_xcr0",
"Vale.Stdcalls.X64.Cpuid.dom",
"Prims.Nil",
"Vale.Interop.Base.arg",
"Vale.AsLowStar.Wrapper.pre_rel_generic",
"Vale.Interop.X64.max_stdcall",
"Vale.Interop.X64.arg_reg_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre",
"Vale.AsLowStar.Wrapper.post_rel_generic",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_post",
"Vale.AsLowStar.Wrapper.mk_prediction",
"Vale.Interop.X64.regs_modified_stdcall",
"Vale.Interop.X64.xmms_modified_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_lemma",
"Vale.Interop.Assumptions.win"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma'
noextract
let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx_xcr0 wrapper *)
[@__reduce__] noextract
let lowstar_avx_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx512_xcr0_pre avx512_xcr0_post) avx512_xcr0_lemma'
noextract
let code_avx512_xcr0 = VC.va_code_Check_avx512_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx512_xcr0 wrapper *)
[@__reduce__] noextract | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lowstar_avx512_xcr0_t : Type0 | [] | Vale.Stdcalls.X64.Cpuid.lowstar_avx512_xcr0_t | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 89,
"end_line": 605,
"start_col": 2,
"start_line": 599
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx512_xcr0_pre avx512_xcr0_post) avx512_xcr0_lemma' | let avx512_xcr0_lemma = | false | null | false | as_t #(VSig.vale_sig_stdcall avx512_xcr0_pre avx512_xcr0_post) avx512_xcr0_lemma' | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [
"total"
] | [
"Vale.Stdcalls.X64.Cpuid.as_t",
"Vale.AsLowStar.ValeSig.vale_sig_stdcall",
"Vale.Stdcalls.X64.Cpuid.dom",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_post",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_lemma'"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma'
noextract
let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx_xcr0 wrapper *)
[@__reduce__] noextract
let lowstar_avx_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *) | false | true | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_xcr0_lemma : Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre
Vale.Stdcalls.X64.Cpuid.avx512_xcr0_post | [] | Vale.Stdcalls.X64.Cpuid.avx512_xcr0_lemma | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Vale.AsLowStar.ValeSig.vale_sig_stdcall Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre
Vale.Stdcalls.X64.Cpuid.avx512_xcr0_post | {
"end_col": 105,
"end_line": 592,
"start_col": 24,
"start_line": 592
} |
|
Prims.Ghost | val movbe_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires movbe_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win | val movbe_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires movbe_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
let movbe_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires movbe_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_movbe_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.movbe_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.movbe_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val movbe_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires movbe_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.movbe_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 52,
"end_line": 300,
"start_col": 3,
"start_line": 300
} |
Prims.Ghost | val rdrand_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires rdrand_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win | val rdrand_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires rdrand_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
let rdrand_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires rdrand_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_rdrand_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.rdrand_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.rdrand_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val rdrand_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires rdrand_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.rdrand_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 53,
"end_line": 396,
"start_col": 3,
"start_line": 396
} |
Prims.Ghost | val osxsave_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires osxsave_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win | val osxsave_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires osxsave_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
let osxsave_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires osxsave_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_osxsave_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.osxsave_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.osxsave_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val osxsave_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires osxsave_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.osxsave_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 54,
"end_line": 492,
"start_col": 3,
"start_line": 492
} |
Prims.Ghost | val avx512_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win | val avx512_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
let avx512_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_avx512_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.avx512_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.avx512_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 53,
"end_line": 444,
"start_col": 3,
"start_line": 444
} |
Prims.Ghost | val adx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires adx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win | val adx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires adx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
let adx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires adx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_adx_bmi2_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.adx_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.adx_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val adx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires adx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.adx_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 55,
"end_line": 156,
"start_col": 3,
"start_line": 156
} |
Prims.Ghost | val avx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win | val avx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
let avx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_avx_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_avx_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.avx_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.avx_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 50,
"end_line": 204,
"start_col": 3,
"start_line": 204
} |
Prims.Ghost | val avx2_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx2_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win | val avx2_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx2_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
let avx2_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx2_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_avx2_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.avx2_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx2_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx2_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx2_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.avx2_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 51,
"end_line": 252,
"start_col": 3,
"start_line": 252
} |
Prims.Ghost | val avx_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win | val avx_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
let avx_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_avx_xcr0_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx_xcr0_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.avx_xcr0_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 55,
"end_line": 540,
"start_col": 3,
"start_line": 540
} |
Prims.Ghost | val avx512_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let avx512_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_xcr0_stdcall code va_s0 IA.win | val avx512_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f))
let avx512_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_avx512_xcr0_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_avx512_xcr0_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.avx512_xcr0_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sse_lemma = as_t #(VSig.vale_sig_stdcall sse_pre sse_post) sse_lemma'
noextract
let code_sse = VC.va_code_Check_sse_stdcall IA.win
(* Here's the type expected for the check_sse wrapper *)
[@__reduce__] noextract
let lowstar_sse_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sse
dom
[]
_
_
(W.mk_prediction code_sse dom [] (sse_lemma code_sse IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let rdrand_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_rdrand_stdcall c va_s0 IA.win
[@__reduce__] noextract
let rdrand_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_rdrand_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let rdrand_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
rdrand_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
rdrand_post code va_s0 va_s1 f))
= VC.va_lemma_Check_rdrand_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let rdrand_lemma = as_t #(VSig.vale_sig_stdcall rdrand_pre rdrand_post) rdrand_lemma'
noextract
let code_rdrand = VC.va_code_Check_rdrand_stdcall IA.win
(* Here's the type expected for the check_rdrand wrapper *)
[@__reduce__] noextract
let lowstar_rdrand_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_rdrand
dom
[]
_
_
(W.mk_prediction code_rdrand dom [] (rdrand_lemma code_rdrand IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx512_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx512_lemma = as_t #(VSig.vale_sig_stdcall avx512_pre avx512_post) avx512_lemma'
noextract
let code_avx512 = VC.va_code_Check_avx512_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx512_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx512
dom
[]
_
_
(W.mk_prediction code_avx512 dom [] (avx512_lemma code_avx512 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let osxsave_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_osxsave_stdcall c va_s0 IA.win
[@__reduce__] noextract
let osxsave_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_osxsave_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let osxsave_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
osxsave_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
osxsave_post code va_s0 va_s1 f))
= VC.va_lemma_Check_osxsave_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let osxsave_lemma = as_t #(VSig.vale_sig_stdcall osxsave_pre osxsave_post) osxsave_lemma'
noextract
let code_osxsave = VC.va_code_Check_osxsave_stdcall IA.win
(* Here's the type expected for the check_osxsave wrapper *)
[@__reduce__] noextract
let lowstar_osxsave_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_osxsave
dom
[]
_
_
(W.mk_prediction code_osxsave dom [] (osxsave_lemma code_osxsave IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_xcr0_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_xcr0_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_xcr0_lemma = as_t #(VSig.vale_sig_stdcall avx_xcr0_pre avx_xcr0_post) avx_xcr0_lemma'
noextract
let code_avx_xcr0 = VC.va_code_Check_avx_xcr0_stdcall IA.win
(* Here's the type expected for the check_avx_xcr0 wrapper *)
[@__reduce__] noextract
let lowstar_avx_xcr0_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx_xcr0
dom
[]
_
_
(W.mk_prediction code_avx_xcr0 dom [] (avx_xcr0_lemma code_avx_xcr0 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx512_xcr0_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx512_xcr0_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx512_xcr0_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx512_xcr0_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx512_xcr0_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx512_xcr0_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val avx512_xcr0_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires avx512_xcr0_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx512_xcr0_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.avx512_xcr0_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 58,
"end_line": 588,
"start_col": 3,
"start_line": 588
} |
Prims.Ghost | val sse_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sse_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f)) | [
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.X64.Cpuidstdcall",
"short_module": "VC"
},
{
"abbrev": false,
"full_module": "Vale.X64.MemoryAdapters",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.Wrapper",
"short_module": "W"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Assumptions",
"short_module": "IA"
},
{
"abbrev": true,
"full_module": "Vale.X64.Decls",
"short_module": "V"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.LowStarSig",
"short_module": "LSig"
},
{
"abbrev": true,
"full_module": "Vale.AsLowStar.ValeSig",
"short_module": "VSig"
},
{
"abbrev": true,
"full_module": "Vale.Interop.X64",
"short_module": "IX64"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Stdcalls.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sse_stdcall code va_s0 IA.win | val sse_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sse_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f))
let sse_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sse_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f)) = | false | null | false | VC.va_lemma_Check_sse_stdcall code va_s0 IA.win | {
"checked_file": "Vale.Stdcalls.X64.Cpuid.fsti.checked",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.MemoryAdapters.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.Lib.X64.Cpuidstdcall.fsti.checked",
"Vale.Interop.X64.fsti.checked",
"Vale.Interop.Base.fst.checked",
"Vale.Interop.Assumptions.fst.checked",
"Vale.AsLowStar.Wrapper.fsti.checked",
"Vale.AsLowStar.ValeSig.fst.checked",
"Vale.AsLowStar.LowStarSig.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Stdcalls.X64.Cpuid.fsti"
} | [] | [
"Vale.X64.Decls.va_code",
"Prims.bool",
"Vale.X64.Decls.va_state",
"Vale.Lib.X64.Cpuidstdcall.va_lemma_Check_sse_stdcall",
"Vale.Interop.Assumptions.win",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.Decls.va_fuel",
"Vale.Stdcalls.X64.Cpuid.sse_pre",
"Prims.l_and",
"Vale.X64.Decls.eval_code",
"Vale.AsLowStar.ValeSig.vale_calling_conventions_stdcall",
"Vale.Stdcalls.X64.Cpuid.sse_post"
] | [] | module Vale.Stdcalls.X64.Cpuid
open FStar.Mul
open Vale.Interop.Base
module IX64 = Vale.Interop.X64
module VSig = Vale.AsLowStar.ValeSig
module LSig = Vale.AsLowStar.LowStarSig
module V = Vale.X64.Decls
module IA = Vale.Interop.Assumptions
module W = Vale.AsLowStar.Wrapper
open Vale.X64.MemoryAdapters
module VC = Vale.Lib.X64.Cpuidstdcall
(* A little utility to trigger normalization in types *)
noextract
let as_t (#a:Type) (x:normal a) : a = x
noextract
let as_normal_t (#a:Type) (x:a) : normal a = x
[@__reduce__] noextract
let dom: IX64.arity_ok_stdcall td = []
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let aesni_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_aesni_stdcall c va_s0 IA.win
[@__reduce__] noextract
let aesni_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_aesni_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let aesni_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
aesni_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
aesni_post code va_s0 va_s1 f))
= VC.va_lemma_Check_aesni_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let aesni_lemma = as_t #(VSig.vale_sig_stdcall aesni_pre aesni_post) aesni_lemma'
noextract
let code_aesni = VC.va_code_Check_aesni_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_aesni_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_aesni
dom
[]
_
_
(W.mk_prediction code_aesni dom [] (aesni_lemma code_aesni IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sha_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sha_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sha_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sha_stdcall c va_s0 IA.win va_s1 f
open Vale.X64.Machine_s
open Vale.X64.State
#set-options "--z3rlimit 20"
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sha_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sha_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sha_post code va_s0 va_s1 f))
= VC.va_lemma_Check_sha_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let sha_lemma = as_t #(VSig.vale_sig_stdcall sha_pre sha_post) sha_lemma'
noextract
let code_sha = VC.va_code_Check_sha_stdcall IA.win
(* Here's the type expected for the check_aesni wrapper *)
[@__reduce__] noextract
let lowstar_sha_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_sha
dom
[]
_
_
(W.mk_prediction code_sha dom [] (sha_lemma code_sha IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let adx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_adx_bmi2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let adx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_adx_bmi2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let adx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
adx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
adx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_adx_bmi2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let adx_lemma = as_t #(VSig.vale_sig_stdcall adx_pre adx_post) adx_lemma'
noextract
let code_adx = VC.va_code_Check_adx_bmi2_stdcall IA.win
(* Here's the type expected for the check_adx wrapper *)
[@__reduce__] noextract
let lowstar_adx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_adx
dom
[]
_
_
(W.mk_prediction code_adx dom [] (adx_lemma code_adx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx_lemma = as_t #(VSig.vale_sig_stdcall avx_pre avx_post) avx_lemma'
noextract
let code_avx = VC.va_code_Check_avx_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx
dom
[]
_
_
(W.mk_prediction code_avx dom [] (avx_lemma code_avx IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let avx2_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_avx2_stdcall c va_s0 IA.win
[@__reduce__] noextract
let avx2_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_avx2_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let avx2_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
avx2_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
avx2_post code va_s0 va_s1 f))
= VC.va_lemma_Check_avx2_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let avx2_lemma = as_t #(VSig.vale_sig_stdcall avx2_pre avx2_post) avx2_lemma'
noextract
let code_avx2 = VC.va_code_Check_avx2_stdcall IA.win
(* Here's the type expected for the check_avx wrapper *)
[@__reduce__] noextract
let lowstar_avx2_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_avx2
dom
[]
_
_
(W.mk_prediction code_avx2 dom [] (avx2_lemma code_avx2 IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let movbe_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_movbe_stdcall c va_s0 IA.win
[@__reduce__] noextract
let movbe_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_movbe_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let movbe_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
movbe_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
movbe_post code va_s0 va_s1 f))
= VC.va_lemma_Check_movbe_stdcall code va_s0 IA.win
(* Prove that vm_lemma' has the required type *)
noextract
let movbe_lemma = as_t #(VSig.vale_sig_stdcall movbe_pre movbe_post) movbe_lemma'
noextract
let code_movbe = VC.va_code_Check_movbe_stdcall IA.win
(* Here's the type expected for the check_movbe wrapper *)
[@__reduce__] noextract
let lowstar_movbe_t =
IX64.as_lowstar_sig_t_weak_stdcall
code_movbe
dom
[]
_
_
(W.mk_prediction code_movbe dom [] (movbe_lemma code_movbe IA.win))
(* Need to rearrange the order of arguments *)
[@__reduce__] noextract
let sse_pre : VSig.vale_pre dom =
fun (c:V.va_code)
(va_s0:V.va_state) ->
VC.va_req_Check_sse_stdcall c va_s0 IA.win
[@__reduce__] noextract
let sse_post : VSig.vale_post dom =
fun (c:V.va_code)
(va_s0:V.va_state)
(va_s1:V.va_state)
(f:V.va_fuel) ->
VC.va_ens_Check_sse_stdcall c va_s0 IA.win va_s1 f
(* The vale lemma doesn't quite suffice to prove the modifies clause
expected of the interop layer *)
[@__reduce__] noextract
let sse_lemma'
(code:V.va_code)
(_win:bool)
(va_s0:V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires
sse_pre code va_s0)
(ensures (fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\
VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\ | false | false | Vale.Stdcalls.X64.Cpuid.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val sse_lemma' (code: V.va_code) (_win: bool) (va_s0: V.va_state)
: Ghost (V.va_state & V.va_fuel)
(requires sse_pre code va_s0)
(ensures
(fun (va_s1, f) ->
V.eval_code code va_s0 f va_s1 /\ VSig.vale_calling_conventions_stdcall va_s0 va_s1 /\
sse_post code va_s0 va_s1 f)) | [] | Vale.Stdcalls.X64.Cpuid.sse_lemma' | {
"file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Cpuid.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | code: Vale.X64.Decls.va_code -> _win: Prims.bool -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 50,
"end_line": 348,
"start_col": 3,
"start_line": 348
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
} | let map (k: eqtype) (v: Type) = | false | null | false | m: Map.t k v {(Map.domain m) `Set.equal` (Set.complement Set.empty)} | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.Map.t",
"FStar.Set.equal",
"FStar.Map.domain",
"FStar.Set.complement",
"FStar.Set.empty"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal. | false | true | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val map : k: Prims.eqtype -> v: Type -> Type | [] | Steel.PCMMap.map | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | k: Prims.eqtype -> v: Type -> Type | {
"end_col": 3,
"end_line": 34,
"start_col": 2,
"start_line": 32
} |
|
Prims.Tot | val composable_maps (#a: _) (#k: eqtype) (p: pcm a) (m0 m1: map k a) : prop | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k | val composable_maps (#a: _) (#k: eqtype) (p: pcm a) (m0 m1: map k a) : prop
let composable_maps (#a: _) (#k: eqtype) (p: pcm a) (m0 m1: map k a) : prop = | false | null | false | forall k. composable p (Map.sel m0 k) (Map.sel m1 k) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"Prims.l_Forall",
"FStar.PCM.composable",
"FStar.Map.sel",
"Prims.prop"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val composable_maps (#a: _) (#k: eqtype) (p: pcm a) (m0 m1: map k a) : prop | [] | Steel.PCMMap.composable_maps | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.PCM.pcm a -> m0: Steel.PCMMap.map k a -> m1: Steel.PCMMap.map k a -> Prims.prop | {
"end_col": 54,
"end_line": 42,
"start_col": 4,
"start_line": 42
} |
Prims.Tot | val compose_maps
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0: map k a)
(m1: map k a {composable_maps p m0 m1})
: map k a | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k) | val compose_maps
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0: map k a)
(m1: map k a {composable_maps p m0 m1})
: map k a
let compose_maps
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0: map k a)
(m1: map k a {composable_maps p m0 m1})
: map k a = | false | null | false | Map.map_literal (fun k -> op p (Map.sel m0 k) (Map.sel m1 k)) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"Steel.PCMMap.composable_maps",
"FStar.Map.map_literal",
"FStar.PCM.op",
"FStar.Map.sel"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 }) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compose_maps
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0: map k a)
(m1: map k a {composable_maps p m0 m1})
: map k a | [] | Steel.PCMMap.compose_maps | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p: FStar.PCM.pcm a ->
m0: Steel.PCMMap.map k a ->
m1: Steel.PCMMap.map k a {Steel.PCMMap.composable_maps p m0 m1}
-> Steel.PCMMap.map k a | {
"end_col": 56,
"end_line": 51,
"start_col": 4,
"start_line": 50
} |
Prims.Tot | val pcm'_map_of_pcm (#a: _) (k: eqtype) (p: pcm a) : pcm' (map k a) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
} | val pcm'_map_of_pcm (#a: _) (k: eqtype) (p: pcm a) : pcm' (map k a)
let pcm'_map_of_pcm (#a: _) (k: eqtype) (p: pcm a) : pcm' (map k a) = | false | null | false | { composable = composable_maps p; op = compose_maps p; one = Map.const p.p.one } | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"FStar.PCM.Mkpcm'",
"Steel.PCMMap.map",
"Steel.PCMMap.composable_maps",
"Steel.PCMMap.compose_maps",
"FStar.Map.const",
"FStar.PCM.__proj__Mkpcm'__item__one",
"FStar.PCM.__proj__Mkpcm__item__p",
"FStar.PCM.pcm'"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pcm'_map_of_pcm (#a: _) (k: eqtype) (p: pcm a) : pcm' (map k a) | [] | Steel.PCMMap.pcm'_map_of_pcm | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | k: Prims.eqtype -> p: FStar.PCM.pcm a -> FStar.PCM.pcm' (Steel.PCMMap.map k a) | {
"end_col": 30,
"end_line": 138,
"start_col": 7,
"start_line": 136
} |
Prims.Tot | val pointwise (#a: _) (k: eqtype) (p: pcm a) : pcm (map k a) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a)
= {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
} | val pointwise (#a: _) (k: eqtype) (p: pcm a) : pcm (map k a)
let pointwise (#a: _) (k: eqtype) (p: pcm a) : pcm (map k a) = | false | null | false | {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
} | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"FStar.PCM.Mkpcm",
"Steel.PCMMap.map",
"Steel.PCMMap.pcm'_map_of_pcm",
"FStar.PCM.__proj__Mkpcm'__item__composable",
"Steel.PCMMap.compose_maps_comm",
"Prims.unit",
"Prims.l_and",
"FStar.PCM.__proj__Mkpcm'__item__op",
"Steel.PCMMap.composable_maps_assoc_l",
"Steel.PCMMap.composable_maps_assoc_r",
"Steel.PCMMap.is_unit",
"Prims.l_Forall",
"FStar.PCM.__proj__Mkpcm__item__refine",
"FStar.Map.sel",
"Prims.prop"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
)
/// The main function of this module:
/// Given a [k] and [p:pcm a], lift it pointwise
let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pointwise (#a: _) (k: eqtype) (p: pcm a) : pcm (map k a) | [] | Steel.PCMMap.pointwise | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | k: Prims.eqtype -> p: FStar.PCM.pcm a -> FStar.PCM.pcm (Steel.PCMMap.map k a) | {
"end_col": 59,
"end_line": 167,
"start_col": 7,
"start_line": 162
} |
FStar.Pervasives.Lemma | val compose_maps_comm (#k #a: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10) | val compose_maps_comm (#k #a: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
let compose_maps_comm #k #a (p: pcm a) (m0: map k a) (m1: map k a)
: Lemma (requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0) = | false | null | true | let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key . Map.sel m01 key == Map.sel m10 key
with (p.comm (Map.sel m0 key) (Map.sel m1 key));
assert (Map.equal m01 m10) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"Prims._assert",
"FStar.Map.equal",
"Prims.unit",
"FStar.Classical.Sugar.forall_intro",
"Prims.eq2",
"FStar.Map.sel",
"FStar.PCM.__proj__Mkpcm__item__comm",
"Prims.squash",
"Steel.PCMMap.compose_maps",
"Steel.PCMMap.composable_maps",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compose_maps_comm (#k #a: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0) | [] | Steel.PCMMap.compose_maps_comm | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.PCM.pcm a -> m0: Steel.PCMMap.map k a -> m1: Steel.PCMMap.map k a
-> FStar.Pervasives.Lemma (requires Steel.PCMMap.composable_maps p m0 m1)
(ensures Steel.PCMMap.compose_maps p m0 m1 == Steel.PCMMap.compose_maps p m1 m0) | {
"end_col": 30,
"end_line": 73,
"start_col": 3,
"start_line": 68
} |
FStar.Pervasives.Lemma | val compatible_pointwise (#a #k: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compatible_pointwise #a #k
(p:pcm a)
(m0 m1:map k a)
: Lemma
(requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k))
= let pcm' = pointwise k p in
introduce forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)
with (
eliminate exists frame.
composable pcm' m0 frame /\ op pcm' frame m0 == m1
returns _
with _. (
introduce exists (frame:a).
composable p
(Map.sel m0 k)
frame /\
op p frame (Map.sel m0 k) == Map.sel m1 k
with (Map.sel frame k)
and ())) | val compatible_pointwise (#a #k: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k))
let compatible_pointwise #a #k (p: pcm a) (m0: map k a) (m1: map k a)
: Lemma (requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)) = | false | null | true | let pcm' = pointwise k p in
introduce forall k . compatible p (Map.sel m0 k) (Map.sel m1 k)
with (eliminate exists frame.
composable pcm' m0 frame /\ op pcm' frame m0 == m1
returns _
with _.
(introduce exists (frame: a).composable p (Map.sel m0 k) frame /\
op p frame (Map.sel m0 k) == Map.sel m1 k
with (Map.sel frame k)
and ())) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"FStar.Classical.Sugar.forall_intro",
"FStar.PCM.compatible",
"FStar.Map.sel",
"FStar.Classical.Sugar.exists_elim",
"Prims.l_and",
"FStar.PCM.composable",
"Prims.eq2",
"FStar.PCM.op",
"Prims.l_Exists",
"Prims.squash",
"FStar.Classical.Sugar.exists_intro",
"Prims.unit",
"Steel.PCMMap.pointwise",
"Prims.l_Forall",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
)
/// The main function of this module:
/// Given a [k] and [p:pcm a], lift it pointwise
let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a)
= {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
}
/// Now some constructions that allow us to lift frame-preserving updates
/// If a two maps are compatible, then they are also compatible pointwise
let compatible_pointwise #a #k
(p:pcm a)
(m0 m1:map k a)
: Lemma
(requires compatible (pointwise k p) m0 m1) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compatible_pointwise (#a #k: _) (p: pcm a) (m0 m1: map k a)
: Lemma (requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)) | [] | Steel.PCMMap.compatible_pointwise | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.PCM.pcm a -> m0: Steel.PCMMap.map k a -> m1: Steel.PCMMap.map k a
-> FStar.Pervasives.Lemma (requires FStar.PCM.compatible (Steel.PCMMap.pointwise k p) m0 m1)
(ensures forall (k: k). FStar.PCM.compatible p (FStar.Map.sel m0 k) (FStar.Map.sel m1 k)) | {
"end_col": 16,
"end_line": 192,
"start_col": 3,
"start_line": 179
} |
FStar.Pervasives.Lemma | val is_unit (#k #a: _) (p: pcm a) (m: map k a)
: Lemma
(composable_maps p (Map.const p.p.one) m /\ (compose_maps p (Map.const p.p.one) m) `Map.equal` m /\
(compose_maps p m (Map.const p.p.one)) `Map.equal` m) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
) | val is_unit (#k #a: _) (p: pcm a) (m: map k a)
: Lemma
(composable_maps p (Map.const p.p.one) m /\ (compose_maps p (Map.const p.p.one) m) `Map.equal` m /\
(compose_maps p m (Map.const p.p.one)) `Map.equal` m)
let is_unit #k #a (p: pcm a) (m: map k a)
: Lemma
(composable_maps p (Map.const p.p.one) m /\ (compose_maps p (Map.const p.p.one) m) `Map.equal` m /\
(compose_maps p m (Map.const p.p.one)) `Map.equal` m) = | false | null | true | introduce forall k . composable p p.p.one (Map.sel m k)
with (p.is_unit (Map.sel m k));
introduce forall k . Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"FStar.Classical.Sugar.forall_intro",
"Prims.l_and",
"Prims.eq2",
"FStar.Map.sel",
"Steel.PCMMap.compose_maps",
"FStar.Map.const",
"FStar.PCM.__proj__Mkpcm'__item__one",
"FStar.PCM.__proj__Mkpcm__item__p",
"FStar.PCM.__proj__Mkpcm__item__comm",
"Prims.unit",
"FStar.PCM.__proj__Mkpcm__item__is_unit",
"Prims.squash",
"FStar.PCM.composable",
"Prims.l_True",
"Steel.PCMMap.composable_maps",
"FStar.Map.equal",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\ | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val is_unit (#k #a: _) (p: pcm a) (m: map k a)
: Lemma
(composable_maps p (Map.const p.p.one) m /\ (compose_maps p (Map.const p.p.one) m) `Map.equal` m /\
(compose_maps p m (Map.const p.p.one)) `Map.equal` m) | [] | Steel.PCMMap.is_unit | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.PCM.pcm a -> m: Steel.PCMMap.map k a
-> FStar.Pervasives.Lemma
(ensures
Steel.PCMMap.composable_maps p (FStar.Map.const (Mkpcm'?.one (Mkpcm?.p p))) m /\
FStar.Map.equal (Steel.PCMMap.compose_maps p (FStar.Map.const (Mkpcm'?.one (Mkpcm?.p p))) m) m /\
FStar.Map.equal (Steel.PCMMap.compose_maps p m (FStar.Map.const (Mkpcm'?.one (Mkpcm?.p p)))) m
) | {
"end_col": 6,
"end_line": 155,
"start_col": 5,
"start_line": 146
} |
FStar.Pervasives.Lemma | val composable_maps_assoc_l (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2))) | val composable_maps_assoc_l (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2))
let composable_maps_assoc_l #k #a (p: pcm a) (m0: map k a) (m1: map k a) (m2: map k a)
: Lemma (requires composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) = | false | null | true | introduce forall key . composable p (Map.sel m0 key) (Map.sel m1 key)
with (p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
let m01 = compose_maps p m0 m1 in
introduce forall key . composable p (Map.sel m01 key) (Map.sel m2 key)
with (p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key . Map.sel m012 key == Map.sel m012' key
with (p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
assert (Map.equal (compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2))) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"Prims._assert",
"FStar.Map.equal",
"Steel.PCMMap.compose_maps",
"Prims.unit",
"FStar.Classical.Sugar.forall_intro",
"Prims.eq2",
"FStar.Map.sel",
"FStar.PCM.__proj__Mkpcm__item__assoc",
"Prims.squash",
"FStar.PCM.composable",
"Prims.l_and",
"Steel.PCMMap.composable_maps",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 == | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val composable_maps_assoc_l (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) | [] | Steel.PCMMap.composable_maps_assoc_l | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p: FStar.PCM.pcm a ->
m0: Steel.PCMMap.map k a ->
m1: Steel.PCMMap.map k a ->
m2: Steel.PCMMap.map k a
-> FStar.Pervasives.Lemma
(requires
Steel.PCMMap.composable_maps p m1 m2 /\
Steel.PCMMap.composable_maps p m0 (Steel.PCMMap.compose_maps p m1 m2))
(ensures
Steel.PCMMap.composable_maps p m0 m1 /\
Steel.PCMMap.composable_maps p (Steel.PCMMap.compose_maps p m0 m1) m2 /\
Steel.PCMMap.compose_maps p (Steel.PCMMap.compose_maps p m0 m1) m2 ==
Steel.PCMMap.compose_maps p m0 (Steel.PCMMap.compose_maps p m1 m2)) | {
"end_col": 60,
"end_line": 102,
"start_col": 4,
"start_line": 88
} |
FStar.Pervasives.Lemma | val composable_maps_assoc_r (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012') | val composable_maps_assoc_r (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2))
let composable_maps_assoc_r #k #a (p: pcm a) (m0: map k a) (m1: map k a) (m2: map k a)
: Lemma (requires composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) = | false | null | true | introduce forall key . composable p (Map.sel m1 key) (Map.sel m2 key)
with (p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
let m12 = compose_maps p m1 m2 in
introduce forall key . composable p (Map.sel m0 key) (Map.sel m12 key)
with (p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key . Map.sel m012 key == Map.sel m012' key
with (p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key));
assert (Map.equal m012 m012') | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"Prims._assert",
"FStar.Map.equal",
"Prims.unit",
"FStar.Classical.Sugar.forall_intro",
"Prims.eq2",
"FStar.Map.sel",
"FStar.PCM.__proj__Mkpcm__item__assoc_r",
"Prims.squash",
"Steel.PCMMap.compose_maps",
"FStar.PCM.composable",
"Prims.l_and",
"Steel.PCMMap.composable_maps",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 == | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val composable_maps_assoc_r (#k #a: _) (p: pcm a) (m0 m1 m2: map k a)
: Lemma (requires composable_maps p m0 m1 /\ composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\ composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 == compose_maps p m0 (compose_maps p m1 m2)) | [] | Steel.PCMMap.composable_maps_assoc_r | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p: FStar.PCM.pcm a ->
m0: Steel.PCMMap.map k a ->
m1: Steel.PCMMap.map k a ->
m2: Steel.PCMMap.map k a
-> FStar.Pervasives.Lemma
(requires
Steel.PCMMap.composable_maps p m0 m1 /\
Steel.PCMMap.composable_maps p (Steel.PCMMap.compose_maps p m0 m1) m2)
(ensures
Steel.PCMMap.composable_maps p m1 m2 /\
Steel.PCMMap.composable_maps p m0 (Steel.PCMMap.compose_maps p m1 m2) /\
Steel.PCMMap.compose_maps p (Steel.PCMMap.compose_maps p m0 m1) m2 ==
Steel.PCMMap.compose_maps p m0 (Steel.PCMMap.compose_maps p m1 m2)) | {
"end_col": 33,
"end_line": 129,
"start_col": 4,
"start_line": 117
} |
Prims.Tot | val lift_frame_preserving_upd
(#a #k: _)
(#p: pcm a)
(v0 v1: Ghost.erased a)
(f: frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key: k{Map.sel m0 key == Ghost.reveal v0})
: frame_preserving_upd (pointwise k p) m0 (Map.upd m0 key v1) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lift_frame_preserving_upd #a #k (#p:pcm a)
(v0 v1: Ghost.erased a)
(f:frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key:k { Map.sel m0 key == Ghost.reveal v0 })
: frame_preserving_upd (pointwise k p) m0 (Map.upd m0 key v1)
= fun full_m0 ->
let p' = pointwise k p in
let full_v0 = Map.sel full_m0 key in
assert (compatible (pointwise _ p) m0 full_m0);
assert (p.refine full_v0);
compatible_pointwise #a #k p m0 full_m0;
assert (compatible p v0 full_v0);
let full_v1 = f full_v0 in
let full_m1 = Map.upd full_m0 key full_v1 in
assert (p'.refine full_m1);
compatible_pointwise_upd p v1 full_v1 m0 full_m0 key;
assert (
let m1 = Map.upd m0 key v1 in
compatible p' m1 full_m1
);
lift_frame_preservation p m0 full_m0 v1 full_v1 key;
full_m1 | val lift_frame_preserving_upd
(#a #k: _)
(#p: pcm a)
(v0 v1: Ghost.erased a)
(f: frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key: k{Map.sel m0 key == Ghost.reveal v0})
: frame_preserving_upd (pointwise k p) m0 (Map.upd m0 key v1)
let lift_frame_preserving_upd
#a
#k
(#p: pcm a)
(v0: Ghost.erased a)
(v1: Ghost.erased a)
(f: frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key: k{Map.sel m0 key == Ghost.reveal v0})
: frame_preserving_upd (pointwise k p) m0 (Map.upd m0 key v1) = | false | null | false | fun full_m0 ->
let p' = pointwise k p in
let full_v0 = Map.sel full_m0 key in
assert (compatible (pointwise _ p) m0 full_m0);
assert (p.refine full_v0);
compatible_pointwise #a #k p m0 full_m0;
assert (compatible p v0 full_v0);
let full_v1 = f full_v0 in
let full_m1 = Map.upd full_m0 key full_v1 in
assert (p'.refine full_m1);
compatible_pointwise_upd p v1 full_v1 m0 full_m0 key;
assert (let m1 = Map.upd m0 key v1 in
compatible p' m1 full_m1);
lift_frame_preservation p m0 full_m0 v1 full_v1 key;
full_m1 | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"total"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"FStar.Ghost.erased",
"FStar.PCM.frame_preserving_upd",
"FStar.Ghost.reveal",
"Steel.PCMMap.map",
"Prims.eq2",
"FStar.Map.sel",
"Prims.l_and",
"FStar.PCM.__proj__Mkpcm__item__refine",
"Steel.PCMMap.pointwise",
"FStar.PCM.compatible",
"Prims.unit",
"Steel.PCMMap.lift_frame_preservation",
"Prims._assert",
"FStar.Map.t",
"FStar.Map.upd",
"Steel.PCMMap.compatible_pointwise_upd",
"Prims.l_Forall",
"FStar.PCM.composable",
"Prims.l_imp",
"FStar.PCM.op",
"Steel.PCMMap.compatible_pointwise"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
)
/// The main function of this module:
/// Given a [k] and [p:pcm a], lift it pointwise
let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a)
= {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
}
/// Now some constructions that allow us to lift frame-preserving updates
/// If a two maps are compatible, then they are also compatible pointwise
let compatible_pointwise #a #k
(p:pcm a)
(m0 m1:map k a)
: Lemma
(requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k))
= let pcm' = pointwise k p in
introduce forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)
with (
eliminate exists frame.
composable pcm' m0 frame /\ op pcm' frame m0 == m1
returns _
with _. (
introduce exists (frame:a).
composable p
(Map.sel m0 k)
frame /\
op p frame (Map.sel m0 k) == Map.sel m1 k
with (Map.sel frame k)
and ()))
/// A very specific lemma for use in lifting frame-preserving updates
///
/// If two maps are compatible, then updating them at a key with
/// values that are compatible produces compatible maps
let compatible_pointwise_upd #a (#k:eqtype)
(p:pcm a)
(v1 full_v1:a)
(m0 full_m0:map k a)
(key:k)
: Lemma
(requires
compatible p v1 full_v1 /\
compatible (pointwise k p) m0 full_m0)
(ensures
compatible (pointwise k p) (Map.upd m0 key v1)
(Map.upd full_m0 key full_v1))
= compatible_pointwise p m0 full_m0;
assert (compatible p (Map.sel m0 key) (Map.sel full_m0 key));
let m1 = (Map.upd m0 key v1) in
let full_m1 = (Map.upd full_m0 key full_v1) in
let p' = pointwise k p in
eliminate exists (frame_m0:_). composable p' m0 frame_m0 /\ op p' frame_m0 m0 == full_m0
returns _
with _. (
eliminate exists (frame0:_). composable p v1 frame0 /\ op p frame0 v1 == full_v1
returns _
with _. (
introduce exists (frame:_).
composable p' m1 frame /\ op p' frame m1 == full_m1
with (Map.upd frame_m0 key frame0)
and (
let w = Map.upd frame_m0 key frame0 in
assert (Map.equal (compose_maps p w m1) full_m1)
)))
/// If any frame composes with [v0] to produce [full_v0]
/// can also be composed with [v1] to produce [full_v1]
///
/// Then any frame composable with a map contains [v0] yielding a map
/// containing [full_v0], is also composable with a map containing
/// [v1] yielding [full_v1] at that key.
let lift_frame_preservation #a (#k:eqtype) (p:pcm a)
(m0 full_m0:map k a)
(v1 full_v1:a)
(key:k)
: Lemma
(requires (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame:a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\
(op p v0 frame == full_v0 ==>
op p v1 frame == full_v1))))
(ensures (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame:_{composable p' m0 frame}).
composable p' m1 frame /\
(op p' m0 frame == full_m0 ==>
op p' m1 frame == full_m1))))
= let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
introduce forall (frame:_{composable p' m0 frame}).
composable p' m1 frame /\
(op p' m0 frame == full_m0 ==>
op p' m1 frame == full_m1)
with (
introduce _ /\ _
with ()
and ( introduce _ ==> _
with _. (
assert (compose_maps p m1 frame `Map.equal` full_m1)
)
)
)
/// Lift a frame-preserving update from [v0] to [v1]
/// to a map contains [v0] at [k] producing the updated map
let lift_frame_preserving_upd #a #k (#p:pcm a)
(v0 v1: Ghost.erased a)
(f:frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key:k { Map.sel m0 key == Ghost.reveal v0 }) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lift_frame_preserving_upd
(#a #k: _)
(#p: pcm a)
(v0 v1: Ghost.erased a)
(f: frame_preserving_upd p v0 v1)
(m0: Ghost.erased (map k a))
(key: k{Map.sel m0 key == Ghost.reveal v0})
: frame_preserving_upd (pointwise k p) m0 (Map.upd m0 key v1) | [] | Steel.PCMMap.lift_frame_preserving_upd | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
v0: FStar.Ghost.erased a ->
v1: FStar.Ghost.erased a ->
f: FStar.PCM.frame_preserving_upd p (FStar.Ghost.reveal v0) (FStar.Ghost.reveal v1) ->
m0: FStar.Ghost.erased (Steel.PCMMap.map k a) ->
key: k{FStar.Map.sel (FStar.Ghost.reveal m0) key == FStar.Ghost.reveal v0}
-> FStar.PCM.frame_preserving_upd (Steel.PCMMap.pointwise k p)
(FStar.Ghost.reveal m0)
(FStar.Map.upd (FStar.Ghost.reveal m0) key (FStar.Ghost.reveal v1)) | {
"end_col": 17,
"end_line": 302,
"start_col": 4,
"start_line": 286
} |
FStar.Pervasives.Lemma | val compatible_pointwise_upd
(#a: _)
(#k: eqtype)
(p: pcm a)
(v1 full_v1: a)
(m0 full_m0: map k a)
(key: k)
: Lemma (requires compatible p v1 full_v1 /\ compatible (pointwise k p) m0 full_m0)
(ensures compatible (pointwise k p) (Map.upd m0 key v1) (Map.upd full_m0 key full_v1)) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compatible_pointwise_upd #a (#k:eqtype)
(p:pcm a)
(v1 full_v1:a)
(m0 full_m0:map k a)
(key:k)
: Lemma
(requires
compatible p v1 full_v1 /\
compatible (pointwise k p) m0 full_m0)
(ensures
compatible (pointwise k p) (Map.upd m0 key v1)
(Map.upd full_m0 key full_v1))
= compatible_pointwise p m0 full_m0;
assert (compatible p (Map.sel m0 key) (Map.sel full_m0 key));
let m1 = (Map.upd m0 key v1) in
let full_m1 = (Map.upd full_m0 key full_v1) in
let p' = pointwise k p in
eliminate exists (frame_m0:_). composable p' m0 frame_m0 /\ op p' frame_m0 m0 == full_m0
returns _
with _. (
eliminate exists (frame0:_). composable p v1 frame0 /\ op p frame0 v1 == full_v1
returns _
with _. (
introduce exists (frame:_).
composable p' m1 frame /\ op p' frame m1 == full_m1
with (Map.upd frame_m0 key frame0)
and (
let w = Map.upd frame_m0 key frame0 in
assert (Map.equal (compose_maps p w m1) full_m1)
))) | val compatible_pointwise_upd
(#a: _)
(#k: eqtype)
(p: pcm a)
(v1 full_v1: a)
(m0 full_m0: map k a)
(key: k)
: Lemma (requires compatible p v1 full_v1 /\ compatible (pointwise k p) m0 full_m0)
(ensures compatible (pointwise k p) (Map.upd m0 key v1) (Map.upd full_m0 key full_v1))
let compatible_pointwise_upd
#a
(#k: eqtype)
(p: pcm a)
(v1: a)
(full_v1: a)
(m0: map k a)
(full_m0: map k a)
(key: k)
: Lemma (requires compatible p v1 full_v1 /\ compatible (pointwise k p) m0 full_m0)
(ensures compatible (pointwise k p) (Map.upd m0 key v1) (Map.upd full_m0 key full_v1)) = | false | null | true | compatible_pointwise p m0 full_m0;
assert (compatible p (Map.sel m0 key) (Map.sel full_m0 key));
let m1 = (Map.upd m0 key v1) in
let full_m1 = (Map.upd full_m0 key full_v1) in
let p' = pointwise k p in
eliminate exists (frame_m0: _).
composable p' m0 frame_m0 /\ op p' frame_m0 m0 == full_m0
returns _
with _.
(eliminate exists (frame0: _).
composable p v1 frame0 /\ op p frame0 v1 == full_v1
returns _
with _.
(introduce exists (frame: _).composable p' m1 frame /\ op p' frame m1 == full_m1
with (Map.upd frame_m0 key frame0)
and (let w = Map.upd frame_m0 key frame0 in
assert (Map.equal (compose_maps p w m1) full_m1)))) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"FStar.Classical.Sugar.exists_elim",
"Prims.l_and",
"FStar.PCM.composable",
"Prims.eq2",
"FStar.PCM.op",
"Prims.l_Exists",
"FStar.Map.t",
"Prims.squash",
"FStar.Classical.Sugar.exists_intro",
"FStar.Map.upd",
"Prims.unit",
"Prims._assert",
"FStar.Map.equal",
"Steel.PCMMap.compose_maps",
"Steel.PCMMap.pointwise",
"FStar.PCM.compatible",
"FStar.Map.sel",
"Steel.PCMMap.compatible_pointwise",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
)
/// The main function of this module:
/// Given a [k] and [p:pcm a], lift it pointwise
let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a)
= {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
}
/// Now some constructions that allow us to lift frame-preserving updates
/// If a two maps are compatible, then they are also compatible pointwise
let compatible_pointwise #a #k
(p:pcm a)
(m0 m1:map k a)
: Lemma
(requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k))
= let pcm' = pointwise k p in
introduce forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)
with (
eliminate exists frame.
composable pcm' m0 frame /\ op pcm' frame m0 == m1
returns _
with _. (
introduce exists (frame:a).
composable p
(Map.sel m0 k)
frame /\
op p frame (Map.sel m0 k) == Map.sel m1 k
with (Map.sel frame k)
and ()))
/// A very specific lemma for use in lifting frame-preserving updates
///
/// If two maps are compatible, then updating them at a key with
/// values that are compatible produces compatible maps
let compatible_pointwise_upd #a (#k:eqtype)
(p:pcm a)
(v1 full_v1:a)
(m0 full_m0:map k a)
(key:k)
: Lemma
(requires
compatible p v1 full_v1 /\
compatible (pointwise k p) m0 full_m0)
(ensures
compatible (pointwise k p) (Map.upd m0 key v1) | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compatible_pointwise_upd
(#a: _)
(#k: eqtype)
(p: pcm a)
(v1 full_v1: a)
(m0 full_m0: map k a)
(key: k)
: Lemma (requires compatible p v1 full_v1 /\ compatible (pointwise k p) m0 full_m0)
(ensures compatible (pointwise k p) (Map.upd m0 key v1) (Map.upd full_m0 key full_v1)) | [] | Steel.PCMMap.compatible_pointwise_upd | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p: FStar.PCM.pcm a ->
v1: a ->
full_v1: a ->
m0: Steel.PCMMap.map k a ->
full_m0: Steel.PCMMap.map k a ->
key: k
-> FStar.Pervasives.Lemma
(requires
FStar.PCM.compatible p v1 full_v1 /\
FStar.PCM.compatible (Steel.PCMMap.pointwise k p) m0 full_m0)
(ensures
FStar.PCM.compatible (Steel.PCMMap.pointwise k p)
(FStar.Map.upd m0 key v1)
(FStar.Map.upd full_m0 key full_v1)) | {
"end_col": 7,
"end_line": 227,
"start_col": 4,
"start_line": 210
} |
FStar.Pervasives.Lemma | val lift_frame_preservation
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0 full_m0: map k a)
(v1 full_v1: a)
(key: k)
: Lemma
(requires
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame: a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\ (op p v0 frame == full_v0 ==> op p v1 frame == full_v1))))
(ensures
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame: _{composable p' m0 frame}).
composable p' m1 frame /\ (op p' m0 frame == full_m0 ==> op p' m1 frame == full_m1)))) | [
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Map",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lift_frame_preservation #a (#k:eqtype) (p:pcm a)
(m0 full_m0:map k a)
(v1 full_v1:a)
(key:k)
: Lemma
(requires (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame:a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\
(op p v0 frame == full_v0 ==>
op p v1 frame == full_v1))))
(ensures (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame:_{composable p' m0 frame}).
composable p' m1 frame /\
(op p' m0 frame == full_m0 ==>
op p' m1 frame == full_m1))))
= let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
introduce forall (frame:_{composable p' m0 frame}).
composable p' m1 frame /\
(op p' m0 frame == full_m0 ==>
op p' m1 frame == full_m1)
with (
introduce _ /\ _
with ()
and ( introduce _ ==> _
with _. (
assert (compose_maps p m1 frame `Map.equal` full_m1)
)
)
) | val lift_frame_preservation
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0 full_m0: map k a)
(v1 full_v1: a)
(key: k)
: Lemma
(requires
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame: a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\ (op p v0 frame == full_v0 ==> op p v1 frame == full_v1))))
(ensures
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame: _{composable p' m0 frame}).
composable p' m1 frame /\ (op p' m0 frame == full_m0 ==> op p' m1 frame == full_m1))))
let lift_frame_preservation
#a
(#k: eqtype)
(p: pcm a)
(m0: map k a)
(full_m0: map k a)
(v1: a)
(full_v1: a)
(key: k)
: Lemma
(requires
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame: a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\ (op p v0 frame == full_v0 ==> op p v1 frame == full_v1))))
(ensures
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame: _{composable p' m0 frame}).
composable p' m1 frame /\ (op p' m0 frame == full_m0 ==> op p' m1 frame == full_m1)))) = | false | null | true | let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
introduce forall (frame: _{composable p' m0 frame}) . composable p' m1 frame /\
(op p' m0 frame == full_m0 ==> op p' m1 frame == full_m1)
with (introduce _ /\ _
with ()
and (introduce _ ==> _
with _. (assert ((compose_maps p m1 frame) `Map.equal` full_m1)))) | {
"checked_file": "Steel.PCMMap.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Map.fsti.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.Sugar.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.PCMMap.fst"
} | [
"lemma"
] | [
"Prims.eqtype",
"FStar.PCM.pcm",
"Steel.PCMMap.map",
"FStar.Classical.Sugar.forall_intro",
"FStar.PCM.composable",
"Prims.l_and",
"Prims.l_imp",
"Prims.eq2",
"FStar.PCM.op",
"FStar.Map.t",
"FStar.Classical.Sugar.and_intro",
"Prims.squash",
"Prims.unit",
"FStar.Classical.Sugar.implies_intro",
"Prims._assert",
"FStar.Map.equal",
"Steel.PCMMap.compose_maps",
"Steel.PCMMap.pointwise",
"FStar.Map.upd",
"FStar.Map.sel",
"Prims.l_Forall",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2021 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.
Author: N. Swamy
*)
module Steel.PCMMap
(** Given a PCM on [p:pcm a] and a key type [k:eqtype], this module
builds a [pcm (map k a)] by lifting [p] pointwise. It also lifts
frame-preserving updates on [p] to frame-preserving updates on
entries of the map. **)
open FStar.Map
open FStar.PCM
/// The carrier type of our constructed PCM
///
/// -- FStar.Map comes with a notion of domain that we don't need here
/// So, we'll just worked with maps whose domain is always
/// universal.
let map (k:eqtype) (v:Type) =
m:Map.t k v {
Map.domain m `Set.equal` Set.complement Set.empty
}
/// Maps are composable if they are composable pointwise
let composable_maps (#a:_)
(#k:eqtype)
(p:pcm a)
(m0 m1: map k a)
: prop
= forall k. Map.sel m0 k `composable p` Map.sel m1 k
/// Compose maps pointwise
let compose_maps (#a:_) (#k:eqtype)
(p:pcm a)
(m0:map k a)
(m1:map k a { composable_maps p m0 m1 })
: map k a
= Map.map_literal (fun k ->
Map.sel m0 k `op p` Map.sel m1 k)
/// Composability is commutative
let composable_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma (composable_maps p m0 m1 <==>
composable_maps p m1 m0)
= ()
/// Composition is commutative
let compose_maps_comm #k #a
(p:pcm a)
(m0 m1: map k a)
: Lemma
(requires composable_maps p m0 m1)
(ensures compose_maps p m0 m1 == compose_maps p m1 m0)
= let m01 = compose_maps p m0 m1 in
let m10 = compose_maps p m1 m0 in
introduce forall key.
Map.sel m01 key == Map.sel m10 key
with ( p.comm (Map.sel m0 key) (Map.sel m1 key) );
assert (Map.equal m01 m10)
/// Composability is left-associative
let composable_maps_assoc_l #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2))
(ensures
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2 /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m0 key) (Map.sel m1 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m01 = compose_maps p m0 m1 in
introduce forall key.
composable p (Map.sel m01 key) (Map.sel m2 key)
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p m01 m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal
(compose_maps p (compose_maps p m0 m1) m2)
(compose_maps p m0 (compose_maps p m1 m2)))
/// Composability is right-associative
let composable_maps_assoc_r #k #a
(p:pcm a)
(m0 m1 m2: map k a)
: Lemma
(requires
composable_maps p m0 m1 /\
composable_maps p (compose_maps p m0 m1) m2)
(ensures
composable_maps p m1 m2 /\
composable_maps p m0 (compose_maps p m1 m2) /\
compose_maps p (compose_maps p m0 m1) m2 ==
compose_maps p m0 (compose_maps p m1 m2))
= introduce forall key.
composable p (Map.sel m1 key) (Map.sel m2 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m12 = compose_maps p m1 m2 in
introduce forall key.
composable p (Map.sel m0 key) (Map.sel m12 key)
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
let m012 = compose_maps p (compose_maps p m0 m1) m2 in
let m012' = compose_maps p m0 (compose_maps p m1 m2) in
introduce forall key.
Map.sel m012 key == Map.sel m012' key
with ( p.assoc_r (Map.sel m0 key) (Map.sel m1 key) (Map.sel m2 key) );
assert (Map.equal m012 m012')
/// The core of the constructed PCM
/// The unit is just the pointwise unit
let pcm'_map_of_pcm (#a:_) (k:eqtype) (p:pcm a)
: pcm' (map k a)
= {
composable = composable_maps p;
op = compose_maps p;
one = Map.const p.p.one
}
/// The unit is really a unit
let is_unit #k #a (p:pcm a) (m:map k a)
: Lemma (composable_maps p (Map.const p.p.one) m /\
compose_maps p (Map.const p.p.one) m `Map.equal` m /\
compose_maps p m (Map.const p.p.one) `Map.equal` m)
= introduce forall k. composable p p.p.one (Map.sel m k)
with (
p.is_unit (Map.sel m k)
);
introduce forall k. Map.sel (compose_maps p (Map.const p.p.one) m) k == Map.sel m k /\
Map.sel (compose_maps p m (Map.const p.p.one)) k == Map.sel m k
with (
p.is_unit (Map.sel m k);
p.comm p.p.one (Map.sel m k)
)
/// The main function of this module:
/// Given a [k] and [p:pcm a], lift it pointwise
let pointwise (#a:_) (k:eqtype) (p:pcm a)
: pcm (map k a)
= {
p = pcm'_map_of_pcm k p;
comm = (fun m0 m1 -> compose_maps_comm p m0 m1);
assoc = (fun m0 m1 m2 -> composable_maps_assoc_l p m0 m1 m2);
assoc_r = (fun m0 m1 m2 -> composable_maps_assoc_r p m0 m1 m2);
is_unit = (fun m -> is_unit p m);
refine = (fun m -> forall k. p.refine (Map.sel m k))
}
/// Now some constructions that allow us to lift frame-preserving updates
/// If a two maps are compatible, then they are also compatible pointwise
let compatible_pointwise #a #k
(p:pcm a)
(m0 m1:map k a)
: Lemma
(requires compatible (pointwise k p) m0 m1)
(ensures forall k. compatible p (Map.sel m0 k) (Map.sel m1 k))
= let pcm' = pointwise k p in
introduce forall k. compatible p (Map.sel m0 k) (Map.sel m1 k)
with (
eliminate exists frame.
composable pcm' m0 frame /\ op pcm' frame m0 == m1
returns _
with _. (
introduce exists (frame:a).
composable p
(Map.sel m0 k)
frame /\
op p frame (Map.sel m0 k) == Map.sel m1 k
with (Map.sel frame k)
and ()))
/// A very specific lemma for use in lifting frame-preserving updates
///
/// If two maps are compatible, then updating them at a key with
/// values that are compatible produces compatible maps
let compatible_pointwise_upd #a (#k:eqtype)
(p:pcm a)
(v1 full_v1:a)
(m0 full_m0:map k a)
(key:k)
: Lemma
(requires
compatible p v1 full_v1 /\
compatible (pointwise k p) m0 full_m0)
(ensures
compatible (pointwise k p) (Map.upd m0 key v1)
(Map.upd full_m0 key full_v1))
= compatible_pointwise p m0 full_m0;
assert (compatible p (Map.sel m0 key) (Map.sel full_m0 key));
let m1 = (Map.upd m0 key v1) in
let full_m1 = (Map.upd full_m0 key full_v1) in
let p' = pointwise k p in
eliminate exists (frame_m0:_). composable p' m0 frame_m0 /\ op p' frame_m0 m0 == full_m0
returns _
with _. (
eliminate exists (frame0:_). composable p v1 frame0 /\ op p frame0 v1 == full_v1
returns _
with _. (
introduce exists (frame:_).
composable p' m1 frame /\ op p' frame m1 == full_m1
with (Map.upd frame_m0 key frame0)
and (
let w = Map.upd frame_m0 key frame0 in
assert (Map.equal (compose_maps p w m1) full_m1)
)))
/// If any frame composes with [v0] to produce [full_v0]
/// can also be composed with [v1] to produce [full_v1]
///
/// Then any frame composable with a map contains [v0] yielding a map
/// containing [full_v0], is also composable with a map containing
/// [v1] yielding [full_v1] at that key.
let lift_frame_preservation #a (#k:eqtype) (p:pcm a)
(m0 full_m0:map k a)
(v1 full_v1:a)
(key:k)
: Lemma
(requires (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame:a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\
(op p v0 frame == full_v0 ==>
op p v1 frame == full_v1))))
(ensures (
let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame:_{composable p' m0 frame}).
composable p' m1 frame /\
(op p' m0 frame == full_m0 ==> | false | false | Steel.PCMMap.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lift_frame_preservation
(#a: _)
(#k: eqtype)
(p: pcm a)
(m0 full_m0: map k a)
(v1 full_v1: a)
(key: k)
: Lemma
(requires
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
(forall (frame: a{composable p v0 frame}). {:pattern composable p v0 frame}
composable p v1 frame /\ (op p v0 frame == full_v0 ==> op p v1 frame == full_v1))))
(ensures
(let v0 = Map.sel m0 key in
let full_v0 = Map.sel full_m0 key in
let m1 = Map.upd m0 key v1 in
let full_m1 = Map.upd full_m0 key full_v1 in
let p' = pointwise k p in
(forall (frame: _{composable p' m0 frame}).
composable p' m1 frame /\ (op p' m0 frame == full_m0 ==> op p' m1 frame == full_m1)))) | [] | Steel.PCMMap.lift_frame_preservation | {
"file_name": "lib/steel/Steel.PCMMap.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
p: FStar.PCM.pcm a ->
m0: Steel.PCMMap.map k a ->
full_m0: Steel.PCMMap.map k a ->
v1: a ->
full_v1: a ->
key: k
-> FStar.Pervasives.Lemma
(requires
(let v0 = FStar.Map.sel m0 key in
let full_v0 = FStar.Map.sel full_m0 key in
let m1 = FStar.Map.upd m0 key v1 in
let full_m1 = FStar.Map.upd full_m0 key full_v1 in
forall (frame: a{FStar.PCM.composable p v0 frame}).
{:pattern FStar.PCM.composable p v0 frame}
FStar.PCM.composable p v1 frame /\
(FStar.PCM.op p v0 frame == full_v0 ==> FStar.PCM.op p v1 frame == full_v1)))
(ensures
(let v0 = FStar.Map.sel m0 key in
let full_v0 = FStar.Map.sel full_m0 key in
let m1 = FStar.Map.upd m0 key v1 in
let full_m1 = FStar.Map.upd full_m0 key full_v1 in
let p' = Steel.PCMMap.pointwise k p in
forall (frame: Steel.PCMMap.map k a {FStar.PCM.composable p' m0 frame}).
FStar.PCM.composable p' m1 frame /\
(FStar.PCM.op p' m0 frame == full_m0 ==> FStar.PCM.op p' m1 frame == full_m1))) | {
"end_col": 7,
"end_line": 276,
"start_col": 5,
"start_line": 259
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k) | let parse_bounded_vlgen_kind (sk: parser_kind) (min: nat) (max: nat{min <= max}) (k: parser_kind) = | false | null | false | and_then_kind sk (parse_bounded_vlgen_payload_kind min max k) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"LowParse.Spec.Base.parser_kind",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.Combinators.and_then_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } ) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_kind : sk: LowParse.Spec.Base.parser_kind ->
min: Prims.nat ->
max: Prims.nat{min <= max} ->
k: LowParse.Spec.Base.parser_kind
-> LowParse.Spec.Base.parser_kind | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_kind | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
sk: LowParse.Spec.Base.parser_kind ->
min: Prims.nat ->
max: Prims.nat{min <= max} ->
k: LowParse.Spec.Base.parser_kind
-> LowParse.Spec.Base.parser_kind | {
"end_col": 63,
"end_line": 117,
"start_col": 2,
"start_line": 117
} |
|
Prims.Tot | val synth_vlgen
(min max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x | val synth_vlgen
(min max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
let synth_vlgen
(min max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t = | false | null | false | x | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val synth_vlgen
(min max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t | [] | LowParse.Spec.VLGen.synth_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat ->
s: LowParse.Spec.Base.serializer p ->
x: LowParse.Spec.VLData.parse_bounded_vldata_strong_t min max s
-> t | {
"end_col": 3,
"end_line": 223,
"start_col": 2,
"start_line": 223
} |
Prims.Tot | val parse_vlgen_weak_kind (kl: parser_kind) (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= and_then_kind kl (parse_vlgen_weak_payload_kind min max) | val parse_vlgen_weak_kind (kl: parser_kind) (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind
let parse_vlgen_weak_kind (kl: parser_kind) (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind = | false | null | false | and_then_kind kl (parse_vlgen_weak_payload_kind min max) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"LowParse.Spec.Base.parser_kind",
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Combinators.and_then_kind",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
)
inline_for_extraction
noextract
let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } ) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_kind (kl: parser_kind) (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind | [] | LowParse.Spec.VLGen.parse_vlgen_weak_kind | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
kl: LowParse.Spec.Base.parser_kind ->
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296}
-> LowParse.Spec.Base.parser_kind | {
"end_col": 58,
"end_line": 488,
"start_col": 2,
"start_line": 488
} |
Prims.Tot | val parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s) | val parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
let parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s)) = | false | null | false | parse_tagged_union pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.Combinators.parse_tagged_union",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s)) | [] | LowParse.Spec.VLGen.parse_bounded_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p
-> LowParse.Spec.Base.parser (LowParse.Spec.VLGen.parse_bounded_vlgen_kind sk min max k)
(LowParse.Spec.VLData.parse_bounded_vldata_strong_t min max s) | {
"end_col": 43,
"end_line": 132,
"start_col": 2,
"start_line": 129
} |
Prims.Tot | val parse_vlgen_weak
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
pk `and_then` parse_vlgen_weak_payload min max p | val parse_vlgen_weak
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t)
let parse_vlgen_weak
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t) = | false | null | false | parse_vlgen_weak_payload_and_then_cases_injective min max p;
pk `and_then` (parse_vlgen_weak_payload min max p) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Combinators.and_then",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload",
"Prims.unit",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_and_then_cases_injective",
"LowParse.Spec.VLGen.parse_vlgen_weak_kind"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
)
inline_for_extraction
noextract
let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= and_then_kind kl (parse_vlgen_weak_payload_kind min max)
let parse_vlgen_weak
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t) | [] | LowParse.Spec.VLGen.parse_vlgen_weak | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
p: LowParse.Spec.Base.parser k t
-> LowParse.Spec.Base.parser (LowParse.Spec.VLGen.parse_vlgen_weak_kind sk min max) t | {
"end_col": 50,
"end_line": 501,
"start_col": 2,
"start_line": 500
} |
Prims.GTot | val parse_vlgen_precond (min: nat) (max: nat{min <= max}) (k: parser_kind) : GTot bool | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max | val parse_vlgen_precond (min: nat) (max: nat{min <= max}) (k: parser_kind) : GTot bool
let parse_vlgen_precond (min: nat) (max: nat{min <= max}) (k: parser_kind) : GTot bool = | false | null | false | match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"sometrivial"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_high",
"Prims.op_AmpAmp",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"Prims.bool"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_precond (min: nat) (max: nat{min <= max}) (k: parser_kind) : GTot bool | [] | LowParse.Spec.VLGen.parse_vlgen_precond | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | min: Prims.nat -> max: Prims.nat{min <= max} -> k: LowParse.Spec.Base.parser_kind
-> Prims.GTot Prims.bool | {
"end_col": 56,
"end_line": 232,
"start_col": 2,
"start_line": 230
} |
Prims.Tot | val parse_vlgen_weak_payload_kind (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None | val parse_vlgen_weak_payload_kind (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind
let parse_vlgen_weak_payload_kind (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind = | false | null | false | strong_parser_kind min max None | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.strong_parser_kind",
"FStar.Pervasives.Native.None",
"LowParse.Spec.Base.parser_kind_metadata_some",
"LowParse.Spec.Base.parser_kind"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } ) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_payload_kind (min: nat) (max: nat{min <= max /\ max < 4294967296})
: Tot parser_kind | [] | LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | min: Prims.nat -> max: Prims.nat{min <= max /\ max < 4294967296} -> LowParse.Spec.Base.parser_kind | {
"end_col": 33,
"end_line": 451,
"start_col": 2,
"start_line": 451
} |
Prims.Tot | val synth_vlgen_recip
(min: nat)
(max: nat{min <= max})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x | val synth_vlgen_recip
(min: nat)
(max: nat{min <= max})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
let synth_vlgen_recip
(min: nat)
(max: nat{min <= max})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s) = | false | null | false | [@@ inline_let ]let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"Prims.unit",
"Prims._assert",
"Prims.l_and",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val synth_vlgen_recip
(min: nat)
(max: nat{min <= max})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s) | [] | LowParse.Spec.VLGen.synth_vlgen_recip | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max} ->
s: LowParse.Spec.Base.serializer p {LowParse.Spec.VLGen.parse_vlgen_precond min max k} ->
x: t
-> LowParse.Spec.VLData.parse_bounded_vldata_strong_t min max s | {
"end_col": 3,
"end_line": 398,
"start_col": 2,
"start_line": 394
} |
Prims.GTot | val tag_of_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x)) | val tag_of_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max) = | false | null | false | U32.uint_to_t (Seq.length (serialize s x)) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"sometrivial"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"FStar.UInt32.uint_to_t",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.BoundedInt.bounded_int32"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val tag_of_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max) | [] | LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
x: LowParse.Spec.VLData.parse_bounded_vldata_strong_t min max s
-> Prims.GTot (LowParse.Spec.BoundedInt.bounded_int32 min max) | {
"end_col": 44,
"end_line": 20,
"start_col": 2,
"start_line": 20
} |
Prims.Tot | val parse_bounded_vlgen_payload_kind (min: nat) (max: nat{min <= max}) (k: parser_kind)
: Tot parser_kind | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
) | val parse_bounded_vlgen_payload_kind (min: nat) (max: nat{min <= max}) (k: parser_kind)
: Tot parser_kind
let parse_bounded_vlgen_payload_kind (min: nat) (max: nat{min <= max}) (k: parser_kind)
: Tot parser_kind = | false | null | false | [@@ inline_let ]let kmin = k.parser_kind_low in
[@@ inline_let ]let min' = if kmin > min then kmin else min in
[@@ inline_let ]let max' =
match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@@ inline_let ]let max' = if max' < min' then min' else max' in
strong_parser_kind min'
max'
(match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.strong_parser_kind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_metadata",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.parser_kind_metadata_some",
"LowParse.Spec.Base.ParserKindMetadataFail",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.None",
"LowParse.Spec.Base.parser_kind_metadata_t",
"Prims.op_LessThan",
"Prims.bool",
"Prims.int",
"Prims.op_GreaterThanOrEqual",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_high",
"Prims.l_and",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_payload_kind (min: nat) (max: nat{min <= max}) (k: parser_kind)
: Tot parser_kind | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | min: Prims.nat -> max: Prims.nat{min <= max} -> k: LowParse.Spec.Base.parser_kind
-> LowParse.Spec.Base.parser_kind | {
"end_col": 3,
"end_line": 56,
"start_col": 2,
"start_line": 41
} |
Prims.Tot | val parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s | val parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
let parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t) = | false | null | false | (parse_bounded_vlgen min max pk s) `parse_synth` (synth_vlgen min max s) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"LowParse.Spec.Combinators.parse_synth",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k }) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t) | [] | LowParse.Spec.VLGen.parse_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p {LowParse.Spec.VLGen.parse_vlgen_precond min max k}
-> LowParse.Spec.Base.parser (LowParse.Spec.VLGen.parse_bounded_vlgen_kind sk min max k) t | {
"end_col": 23,
"end_line": 246,
"start_col": 2,
"start_line": 244
} |
Prims.Tot | val serialize_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s) | val serialize_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
let serialize_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s)) = | false | null | false | serialize_tagged_union ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.ParserStrong",
"LowParse.Spec.Combinators.serialize_tagged_union",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"LowParse.Spec.VLGen.serialize_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s)) | [] | LowParse.Spec.VLGen.serialize_bounded_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
ssk:
LowParse.Spec.Base.serializer pk
{ Mkparser_kind'?.parser_kind_subkind sk ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong } ->
s: LowParse.Spec.Base.serializer p
-> LowParse.Spec.Base.serializer (LowParse.Spec.VLGen.parse_bounded_vlgen min max pk s) | {
"end_col": 47,
"end_line": 358,
"start_col": 2,
"start_line": 355
} |
Prims.Tot | val serialize_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (serializer (parse_vlgen min max pk s)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
() | val serialize_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (serializer (parse_vlgen min max pk s))
let serialize_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (serializer (parse_vlgen min max pk s)) = | false | null | false | serialize_synth (parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
() | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.ParserStrong",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"LowParse.Spec.Combinators.serialize_synth",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen",
"LowParse.Spec.VLGen.serialize_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen_recip",
"LowParse.Spec.VLGen.parse_vlgen"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k }) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
: Tot (serializer (parse_vlgen min max pk s)) | [] | LowParse.Spec.VLGen.serialize_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
ssk:
LowParse.Spec.Base.serializer pk
{ Mkparser_kind'?.parser_kind_subkind sk ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong } ->
s: LowParse.Spec.Base.serializer p {LowParse.Spec.VLGen.parse_vlgen_precond min max k}
-> LowParse.Spec.Base.serializer (LowParse.Spec.VLGen.parse_vlgen min max pk s) | {
"end_col": 6,
"end_line": 416,
"start_col": 2,
"start_line": 411
} |
Prims.Tot | val parse_vlgen_weak_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound)) | val parse_vlgen_weak_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
let parse_vlgen_weak_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t) = | false | null | false | weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound)) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.weaken",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind",
"LowParse.Spec.FLData.parse_fldata_kind",
"FStar.UInt32.v",
"LowParse.Spec.FLData.parse_fldata"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t) | [] | LowParse.Spec.VLGen.parse_vlgen_weak_payload | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
p: LowParse.Spec.Base.parser k t ->
bound: LowParse.Spec.BoundedInt.bounded_int32 min max
-> LowParse.Spec.Base.parser (LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind min max) t | {
"end_col": 79,
"end_line": 461,
"start_col": 2,
"start_line": 461
} |
FStar.Pervasives.Lemma | val parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma (and_then_cases_injective (parse_vlgen_weak_payload min max p)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
) | val parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma (and_then_cases_injective (parse_vlgen_weak_payload min max p))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma (and_then_cases_injective (parse_vlgen_weak_payload min max p)) = | false | null | true | and_then_cases_injective_intro (parse_vlgen_weak_payload min max p)
(fun (x1: bounded_int32 min max) (x2: bounded_int32 min max) b1 b2 ->
parse_injective p (Seq.slice b1 0 (U32.v x1)) (Seq.slice b2 0 (U32.v x2))) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Combinators.and_then_cases_injective_intro",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload",
"LowParse.Bytes.bytes",
"LowParse.Spec.Base.parse_injective",
"FStar.Seq.Base.slice",
"LowParse.Bytes.byte",
"FStar.UInt32.v",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"LowParse.Spec.Combinators.and_then_cases_injective",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p)) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma (and_then_cases_injective (parse_vlgen_weak_payload min max p)) | [] | LowParse.Spec.VLGen.parse_vlgen_weak_payload_and_then_cases_injective | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | min: Prims.nat -> max: Prims.nat{min <= max /\ max < 4294967296} -> p: LowParse.Spec.Base.parser k t
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Combinators.and_then_cases_injective (LowParse.Spec.VLGen.parse_vlgen_weak_payload
min
max
p)) | {
"end_col": 5,
"end_line": 479,
"start_col": 2,
"start_line": 472
} |
Prims.Tot | val parse_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot
(parser (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz) | val parse_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot
(parser (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
let parse_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot
(parser (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)) = | false | null | false | let bounds_off =
k.parser_kind_low > U32.v sz ||
(match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz)
in
if bounds_off
then
fail_parser (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
((parse_fldata_strong s (U32.v sz)) `parse_synth` (synth_bounded_vlgen_payload min max s sz)) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Combinators.fail_parser",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"Prims.bool",
"LowParse.Spec.Base.weaken",
"LowParse.Spec.FLData.parse_fldata_kind",
"FStar.UInt32.v",
"LowParse.Spec.Combinators.parse_synth",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"LowParse.Spec.FLData.parse_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload",
"Prims.op_BarBar",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_high"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot
(parser (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)) | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_payload | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max
-> LowParse.Spec.Base.parser (LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind min max k)
(LowParse.Spec.Base.refine_with_tag (LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload min
max
s)
sz) | {
"end_col": 47,
"end_line": 80,
"start_col": 1,
"start_line": 67
} |
FStar.Pervasives.Lemma | val parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match
parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input
with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\ consumed1 == consumed2
| _ -> False) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\
consumed1 == consumed2
| _ -> False)
=
parse_vlgen_weak_unfold min max pk p input;
parse_bounded_vlgen_unfold min max pk s input | val parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match
parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input
with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\ consumed1 == consumed2
| _ -> False)
let parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match
parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input
with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\ consumed1 == consumed2
| _ -> False) = | false | null | true | parse_vlgen_weak_unfold min max pk p input;
parse_bounded_vlgen_unfold min max pk s input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Bytes.bytes",
"LowParse.Spec.VLGen.parse_bounded_vlgen_unfold",
"Prims.unit",
"LowParse.Spec.VLGen.parse_vlgen_weak_unfold",
"Prims.l_True",
"Prims.squash",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.Spec.Base.consumed_length",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.Base.parse",
"LowParse.Spec.VLGen.parse_vlgen_weak",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"Prims.eq2",
"Prims.l_False",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
)
inline_for_extraction
noextract
let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= and_then_kind kl (parse_vlgen_weak_payload_kind min max)
let parse_vlgen_weak
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
pk `and_then` parse_vlgen_weak_payload min max p
let parse_vlgen_weak_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
and_then_eq pk (parse_vlgen_weak_payload min max p) input
let parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\
consumed1 == consumed2
| _ -> False) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match
parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input
with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\ consumed1 == consumed2
| _ -> False) | [] | LowParse.Spec.VLGen.parse_vlgen_weak_eq_parse_bounded_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
((match
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_vlgen_weak min max pk p) input,
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_bounded_vlgen min max pk s) input
with
| FStar.Pervasives.Native.Mktuple2
#_
#_
(FStar.Pervasives.Native.None #_)
(FStar.Pervasives.Native.None #_) ->
Prims.l_True
| FStar.Pervasives.Native.Mktuple2
#_
#_
(FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ res1 consumed1)
)
(FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ res2 consumed2)
) ->
res1 == res2 /\ consumed1 == consumed2
| _ -> Prims.l_False)
<:
Type0)) | {
"end_col": 47,
"end_line": 554,
"start_col": 2,
"start_line": 553
} |
Prims.Tot | val synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x | val synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz)) = | false | null | false | x | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"FStar.UInt32.v"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz)) | [] | LowParse.Spec.VLGen.synth_bounded_vlgen_payload_recip | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max ->
x:
LowParse.Spec.Base.refine_with_tag (LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload min max s
)
sz
-> LowParse.Spec.FLData.parse_fldata_strong_t s (FStar.UInt32.v sz) | {
"end_col": 3,
"end_line": 295,
"start_col": 2,
"start_line": 295
} |
Prims.Tot | val synth_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x | val synth_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
let synth_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) = | false | null | false | x | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"FStar.UInt32.v",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz)) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val synth_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) | [] | LowParse.Spec.VLGen.synth_bounded_vlgen_payload | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max ->
x: LowParse.Spec.FLData.parse_fldata_strong_t s (FStar.UInt32.v sz)
-> LowParse.Spec.Base.refine_with_tag (LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload min max s)
sz | {
"end_col": 3,
"end_line": 33,
"start_col": 2,
"start_line": 33
} |
FStar.Pervasives.Lemma | val parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma (requires (parse_vlgen_precond min max k))
(ensures
(parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(requires (parse_vlgen_precond min max k))
(ensures (
parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input
))
=
parse_vlgen_weak_unfold min max pk p input;
parse_vlgen_unfold min max pk s input | val parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma (requires (parse_vlgen_precond min max k))
(ensures
(parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input))
let parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma (requires (parse_vlgen_precond min max k))
(ensures
(parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input)) = | false | null | true | parse_vlgen_weak_unfold min max pk p input;
parse_vlgen_unfold min max pk s input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Bytes.bytes",
"LowParse.Spec.VLGen.parse_vlgen_unfold",
"Prims.unit",
"LowParse.Spec.VLGen.parse_vlgen_weak_unfold",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"Prims.squash",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.Spec.Base.consumed_length",
"LowParse.Spec.Base.parse",
"LowParse.Spec.VLGen.parse_vlgen_weak",
"LowParse.Spec.VLGen.parse_vlgen",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
)
inline_for_extraction
noextract
let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= and_then_kind kl (parse_vlgen_weak_payload_kind min max)
let parse_vlgen_weak
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
pk `and_then` parse_vlgen_weak_payload min max p
let parse_vlgen_weak_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
and_then_eq pk (parse_vlgen_weak_payload min max p) input
let parse_vlgen_weak_eq_parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(match parse (parse_vlgen_weak min max pk p) input, parse (parse_bounded_vlgen min max pk s) input with
| None, None -> True
| Some (res1, consumed1), Some (res2, consumed2) ->
res1 == (res2 <: t) /\
consumed1 == consumed2
| _ -> False)
=
parse_vlgen_weak_unfold min max pk p input;
parse_bounded_vlgen_unfold min max pk s input
let parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(requires (parse_vlgen_precond min max k))
(ensures (
parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input
)) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_eq_parse_vlgen
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma (requires (parse_vlgen_precond min max k))
(ensures
(parse (parse_vlgen_weak min max pk p) input == parse (parse_vlgen min max pk s) input)) | [] | LowParse.Spec.VLGen.parse_vlgen_weak_eq_parse_vlgen | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma (requires LowParse.Spec.VLGen.parse_vlgen_precond min max k)
(ensures
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_vlgen_weak min max pk p) input ==
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_vlgen min max pk s) input) | {
"end_col": 39,
"end_line": 573,
"start_col": 2,
"start_line": 572
} |
FStar.Pervasives.Lemma | val serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma (serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input | val serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma (serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma (serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input) = | false | null | true | serialize_synth_eq (parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.Combinators.serialize_synth_eq",
"LowParse.Spec.FLData.parse_fldata_kind",
"FStar.UInt32.v",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"LowParse.Spec.FLData.parse_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload",
"LowParse.Spec.FLData.serialize_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload_recip",
"Prims.unit",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"LowParse.Bytes.bytes",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"LowParse.Spec.VLGen.serialize_bounded_vlgen_payload",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma (serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input) | [] | LowParse.Spec.VLGen.serialize_bounded_vlgen_payload_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max ->
input:
LowParse.Spec.Base.refine_with_tag (LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload min max s
)
sz
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Base.serialize (LowParse.Spec.VLGen.serialize_bounded_vlgen_payload min max s sz
)
input ==
LowParse.Spec.Base.serialize s input) | {
"end_col": 13,
"end_line": 342,
"start_col": 2,
"start_line": 336
} |
FStar.Pervasives.Lemma | val parse_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input | val parse_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None)
let parse_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) = | false | null | true | parse_synth_eq (parse_bounded_vlgen min max pk s) (synth_vlgen min max s) input;
parse_bounded_vlgen_unfold min max pk s input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"LowParse.Bytes.bytes",
"LowParse.Spec.VLGen.parse_bounded_vlgen_unfold",
"Prims.unit",
"LowParse.Spec.Combinators.parse_synth_eq",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen",
"Prims.l_True",
"Prims.squash",
"LowParse.Spec.Base.parse",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.Spec.Base.consumed_length",
"FStar.Pervasives.Native.None",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"Prims.op_Addition",
"FStar.UInt32.v",
"Prims.bool",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"LowParse.Spec.Base.serialize",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Seq.Base.seq",
"FStar.Seq.Base.slice",
"LowParse.Spec.VLGen.parse_vlgen",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) | [] | LowParse.Spec.VLGen.parse_vlgen_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p {LowParse.Spec.VLGen.parse_vlgen_precond min max k} ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
(let res = LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_vlgen min max pk s) input in
(match LowParse.Spec.Base.parse pk input with
| FStar.Pervasives.Native.None #_ -> res == FStar.Pervasives.Native.None
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ len sz) ->
(match FStar.Seq.Base.length input < sz + FStar.UInt32.v len with
| true -> res == FStar.Pervasives.Native.None
| _ ->
let input' = FStar.Seq.Base.slice input sz (sz + FStar.UInt32.v len) in
(match LowParse.Spec.Base.parse p input' with
| FStar.Pervasives.Native.Some
#_
(FStar.Pervasives.Native.Mktuple2 #_ #_ x consumed_x) ->
(match consumed_x = FStar.UInt32.v len with
| true ->
FStar.Seq.Base.length (LowParse.Spec.Base.serialize s x) =
FStar.UInt32.v len /\
res == FStar.Pervasives.Native.Some (x, sz + FStar.UInt32.v len)
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0)
<:
Type0)
<:
Type0)) | {
"end_col": 47,
"end_line": 282,
"start_col": 2,
"start_line": 278
} |
Prims.Tot | val serialize_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
) | val serialize_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz)) = | false | null | false | let bounds_off =
k.parser_kind_low > U32.v sz ||
(match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz)
in
if bounds_off
then
fail_serializer (parse_bounded_vlgen_payload_kind min max k)
(refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
(fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth (parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Combinators.fail_serializer",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"Prims.unit",
"Prims.bool",
"LowParse.Spec.Combinators.serialize_weaken",
"LowParse.Spec.FLData.parse_fldata_kind",
"FStar.UInt32.v",
"LowParse.Spec.Combinators.parse_synth",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"LowParse.Spec.FLData.parse_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload",
"LowParse.Spec.Combinators.serialize_synth",
"LowParse.Spec.FLData.serialize_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload_recip",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"Prims.op_BarBar",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_high"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_bounded_vlgen_payload
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz)) | [] | LowParse.Spec.VLGen.serialize_bounded_vlgen_payload | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max
-> LowParse.Spec.Base.serializer (LowParse.Spec.VLGen.parse_bounded_vlgen_payload min max s sz) | {
"end_col": 7,
"end_line": 323,
"start_col": 1,
"start_line": 306
} |
FStar.Pervasives.Lemma | val serialize_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input | val serialize_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp))
let serialize_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) = | false | null | true | serialize_synth_eq (parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.ParserStrong",
"LowParse.Spec.VLGen.parse_vlgen_precond",
"LowParse.Spec.VLGen.serialize_bounded_vlgen_unfold",
"Prims.unit",
"LowParse.Spec.Combinators.serialize_synth_eq",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen",
"LowParse.Spec.VLGen.serialize_bounded_vlgen",
"LowParse.Spec.VLGen.synth_vlgen_recip",
"Prims.l_True",
"Prims.squash",
"FStar.Seq.Base.seq",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.VLGen.parse_vlgen",
"LowParse.Spec.VLGen.serialize_vlgen",
"FStar.Seq.Base.append",
"FStar.UInt32.uint_to_t",
"FStar.Seq.Base.length",
"LowParse.Bytes.bytes",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p {parse_vlgen_precond min max k})
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) | [] | LowParse.Spec.VLGen.serialize_vlgen_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
ssk:
LowParse.Spec.Base.serializer pk
{ Mkparser_kind'?.parser_kind_subkind sk ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong } ->
s: LowParse.Spec.Base.serializer p {LowParse.Spec.VLGen.parse_vlgen_precond min max k} ->
input: t
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Base.serialize (LowParse.Spec.VLGen.serialize_vlgen min max ssk s) input ==
(let sp = LowParse.Spec.Base.serialize s input in
FStar.Seq.Base.append (LowParse.Spec.Base.serialize ssk
(FStar.UInt32.uint_to_t (FStar.Seq.Base.length sp)))
sp)) | {
"end_col": 52,
"end_line": 441,
"start_col": 2,
"start_line": 434
} |
FStar.Pervasives.Lemma | val serialize_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input | val serialize_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp))
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) = | false | null | true | serialize_tagged_union_eq ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg:bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.ParserStrong",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.serialize_bounded_vlgen_payload_unfold",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"Prims.unit",
"LowParse.Spec.Combinators.serialize_tagged_union_eq",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"LowParse.Spec.VLGen.serialize_bounded_vlgen_payload",
"Prims.l_True",
"Prims.squash",
"FStar.Seq.Base.seq",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.VLGen.parse_bounded_vlgen_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"LowParse.Spec.VLGen.serialize_bounded_vlgen",
"FStar.Seq.Base.append",
"FStar.UInt32.uint_to_t",
"FStar.Seq.Base.length",
"LowParse.Bytes.bytes",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val serialize_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk {sk.parser_kind_subkind == Some ParserStrong})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input ==
(let sp = serialize s input in
(serialize ssk (U32.uint_to_t (Seq.length sp))) `Seq.append` sp)) | [] | LowParse.Spec.VLGen.serialize_bounded_vlgen_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
ssk:
LowParse.Spec.Base.serializer pk
{ Mkparser_kind'?.parser_kind_subkind sk ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong } ->
s: LowParse.Spec.Base.serializer p ->
input: LowParse.Spec.VLData.parse_bounded_vldata_strong_t min max s
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Base.serialize (LowParse.Spec.VLGen.serialize_bounded_vlgen min max ssk s) input ==
(let sp = LowParse.Spec.Base.serialize s input in
FStar.Seq.Base.append (LowParse.Spec.Base.serialize ssk
(FStar.UInt32.uint_to_t (FStar.Seq.Base.length sp)))
sp)) | {
"end_col": 59,
"end_line": 382,
"start_col": 2,
"start_line": 376
} |
FStar.Pervasives.Lemma | val parse_vlgen_weak_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len then res == Some (x, sz + U32.v len) else res == None
| _ -> res == None) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_vlgen_weak_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
and_then_eq pk (parse_vlgen_weak_payload min max p) input | val parse_vlgen_weak_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len then res == Some (x, sz + U32.v len) else res == None
| _ -> res == None)
let parse_vlgen_weak_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len then res == Some (x, sz + U32.v len) else res == None
| _ -> res == None) = | false | null | true | parse_vlgen_weak_payload_and_then_cases_injective min max p;
and_then_eq pk (parse_vlgen_weak_payload min max p) input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Bytes.bytes",
"LowParse.Spec.Combinators.and_then_eq",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_kind",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload",
"Prims.unit",
"LowParse.Spec.VLGen.parse_vlgen_weak_payload_and_then_cases_injective",
"Prims.l_True",
"Prims.squash",
"LowParse.Spec.Base.parse",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.Spec.Base.consumed_length",
"FStar.Pervasives.Native.None",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"Prims.op_Addition",
"FStar.UInt32.v",
"Prims.bool",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Seq.Base.seq",
"FStar.Seq.Base.slice",
"LowParse.Spec.VLGen.parse_vlgen_weak",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len)
inline_for_extraction
let synth_vlgen
(min: nat)
(max: nat)
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: Tot t
= x
let parse_vlgen_precond
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: GTot bool
= match k.parser_kind_high with
| None -> false
| Some kmax -> min <= k.parser_kind_low && kmax <= max
let parse_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (parser (parse_bounded_vlgen_kind sk min max k) t)
= parse_bounded_vlgen min max pk s
`parse_synth`
synth_vlgen min max s
let parse_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: bytes)
: Lemma
(let res = parse (parse_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
input;
parse_bounded_vlgen_unfold min max pk s input
inline_for_extraction
let synth_bounded_vlgen_payload_recip
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Tot (parse_fldata_strong_t s (U32.v sz))
= x
let serialize_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (serializer (parse_bounded_vlgen_payload min max s sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_serializer (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz) (fun _ -> ())
else
serialize_weaken (parse_bounded_vlgen_payload_kind min max k)
(serialize_synth
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
)
let serialize_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
: Lemma
(serialize (serialize_bounded_vlgen_payload min max s sz) input == serialize s input)
= serialize_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
(serialize_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload_recip min max s sz)
()
input
let serialize_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (serializer (parse_bounded_vlgen min max pk s))
= serialize_tagged_union
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
let serialize_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: parse_bounded_vldata_strong_t min max s)
: Lemma
(serialize (serialize_bounded_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_tagged_union_eq
ssk
(tag_of_bounded_vlgen_payload min max s)
(serialize_bounded_vlgen_payload min max s)
input;
let tg : bounded_int32 min max = tag_of_bounded_vlgen_payload min max s input in
serialize_bounded_vlgen_payload_unfold min max s tg input
inline_for_extraction
let synth_vlgen_recip
(min: nat)
(max: nat { min <= max } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k } )
(x: t)
: Tot (parse_bounded_vldata_strong_t min max s)
= [@inline_let] let _ =
let sl = Seq.length (serialize s x) in
assert (min <= sl /\ sl <= max)
in
x
let serialize_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
: Tot (serializer (parse_vlgen min max pk s))
= serialize_synth
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
let serialize_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(#pk: parser sk (bounded_int32 min max))
(ssk: serializer pk { sk.parser_kind_subkind == Some ParserStrong } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p { parse_vlgen_precond min max k })
(input: t)
: Lemma
(serialize (serialize_vlgen min max ssk s) input == (
let sp = serialize s input in
serialize ssk (U32.uint_to_t (Seq.length sp)) `Seq.append` sp
))
= serialize_synth_eq
(parse_bounded_vlgen min max pk s)
(synth_vlgen min max s)
(serialize_bounded_vlgen min max ssk s)
(synth_vlgen_recip min max s)
()
input;
serialize_bounded_vlgen_unfold min max ssk s input
(* What if we are not sure the serializer exists? *)
inline_for_extraction
noextract
let parse_vlgen_weak_payload_kind
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= strong_parser_kind min max None
let parse_vlgen_weak_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(bound: bounded_int32 min max)
: Tot (parser (parse_vlgen_weak_payload_kind min max) t)
= weaken (parse_vlgen_weak_payload_kind min max) (parse_fldata p (U32.v bound))
let parse_vlgen_weak_payload_and_then_cases_injective
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Lemma
(and_then_cases_injective (parse_vlgen_weak_payload min max p))
=
and_then_cases_injective_intro
(parse_vlgen_weak_payload min max p)
(fun (x1 x2: bounded_int32 min max) b1 b2 ->
parse_injective
p
(Seq.slice b1 0 (U32.v x1))
(Seq.slice b2 0 (U32.v x2))
)
inline_for_extraction
noextract
let parse_vlgen_weak_kind
(kl: parser_kind)
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
: Tot parser_kind
= and_then_kind kl (parse_vlgen_weak_payload_kind min max)
let parse_vlgen_weak
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
: Tot (parser (parse_vlgen_weak_kind sk min max) t)
=
parse_vlgen_weak_payload_and_then_cases_injective min max p;
pk `and_then` parse_vlgen_weak_payload min max p
let parse_vlgen_weak_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_vlgen_weak_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(input: bytes)
: Lemma
(let res = parse (parse_vlgen_weak min max pk p) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len then res == Some (x, sz + U32.v len) else res == None
| _ -> res == None) | [] | LowParse.Spec.VLGen.parse_vlgen_weak_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
p: LowParse.Spec.Base.parser k t ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
(let res =
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_vlgen_weak min max pk p) input
in
(match LowParse.Spec.Base.parse pk input with
| FStar.Pervasives.Native.None #_ -> res == FStar.Pervasives.Native.None
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ len sz) ->
(match FStar.Seq.Base.length input < sz + FStar.UInt32.v len with
| true -> res == FStar.Pervasives.Native.None
| _ ->
let input' = FStar.Seq.Base.slice input sz (sz + FStar.UInt32.v len) in
(match LowParse.Spec.Base.parse p input' with
| FStar.Pervasives.Native.Some
#_
(FStar.Pervasives.Native.Mktuple2 #_ #_ x consumed_x) ->
(match consumed_x = FStar.UInt32.v len with
| true -> res == FStar.Pervasives.Native.Some (x, sz + FStar.UInt32.v len)
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0)
<:
Type0)
<:
Type0)) | {
"end_col": 59,
"end_line": 533,
"start_col": 2,
"start_line": 532
} |
FStar.Pervasives.Lemma | val parse_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len) | val parse_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None)
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) = | false | null | true | parse_tagged_union_eq pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1;
if Seq.length input < sz + U32.v len
then ()
else Seq.slice_slice input sz (Seq.length input) 0 (U32.v len) | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Bytes.bytes",
"LowParse.Spec.Base.parse",
"LowParse.Spec.Base.consumed_length",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"Prims.op_Addition",
"FStar.UInt32.v",
"Prims.bool",
"FStar.Seq.Properties.slice_slice",
"Prims.unit",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_unfold",
"FStar.Seq.Base.seq",
"FStar.Seq.Base.slice",
"LowParse.Spec.Combinators.parse_tagged_union_eq",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.None",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"LowParse.Spec.Base.serialize",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1
let parse_bounded_vlgen_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None
end | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
if Seq.length input < sz + U32.v len
then res == None
else
let input' = Seq.slice input sz (sz + U32.v len) in
match parse p input' with
| Some (x, consumed_x) ->
if consumed_x = U32.v len
then Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
else res == None
| _ -> res == None) | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
(let res =
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_bounded_vlgen min max pk s) input
in
(match LowParse.Spec.Base.parse pk input with
| FStar.Pervasives.Native.None #_ -> res == FStar.Pervasives.Native.None
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ len sz) ->
(match FStar.Seq.Base.length input < sz + FStar.UInt32.v len with
| true -> res == FStar.Pervasives.Native.None
| _ ->
let input' = FStar.Seq.Base.slice input sz (sz + FStar.UInt32.v len) in
(match LowParse.Spec.Base.parse p input' with
| FStar.Pervasives.Native.Some
#_
(FStar.Pervasives.Native.Mktuple2 #_ #_ x consumed_x) ->
(match consumed_x = FStar.UInt32.v len with
| true ->
FStar.Seq.Base.length (LowParse.Spec.Base.serialize s x) =
FStar.UInt32.v len /\
res == FStar.Pervasives.Native.Some (x, sz + FStar.UInt32.v len)
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0)
<:
Type0)
<:
Type0)) | {
"end_col": 66,
"end_line": 211,
"start_col": 2,
"start_line": 199
} |
FStar.Pervasives.Lemma | val parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input ==
(match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed))) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input | val parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input ==
(match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)))
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input ==
(match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed))) = | false | null | true | let bounds_off =
k.parser_kind_low > U32.v sz ||
(match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz)
in
if bounds_off
then ()
else
parse_synth_eq (parse_fldata_strong s (U32.v sz)) (synth_bounded_vlgen_payload min max s sz) input | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Bytes.bytes",
"Prims.bool",
"LowParse.Spec.Combinators.parse_synth_eq",
"LowParse.Spec.FLData.parse_fldata_kind",
"FStar.UInt32.v",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"LowParse.Spec.Base.refine_with_tag",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.FLData.parse_fldata_strong",
"LowParse.Spec.VLGen.synth_bounded_vlgen_payload",
"Prims.unit",
"Prims.op_BarBar",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_high",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"LowParse.Spec.Base.consumed_length",
"LowParse.Spec.Base.parse",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"FStar.Pervasives.Native.None",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed) | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input ==
(match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed))) | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_payload_unfold | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
s: LowParse.Spec.Base.serializer p ->
sz: LowParse.Spec.BoundedInt.bounded_int32 min max ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_bounded_vlgen_payload min max s sz) input ==
(match
LowParse.Spec.Base.parse (LowParse.Spec.FLData.parse_fldata_strong s (FStar.UInt32.v sz))
input
with
| FStar.Pervasives.Native.None #_ -> FStar.Pervasives.Native.None
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ x consumed) ->
FStar.Pervasives.Native.Some (x, consumed))) | {
"end_col": 11,
"end_line": 109,
"start_col": 1,
"start_line": 96
} |
FStar.Pervasives.Lemma | val parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
| _ -> res == None) | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.VLData",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.AllIntegers",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.Combinators",
"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
}
] | false | let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end
)
= parse_tagged_union_eq
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1 | val parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
| _ -> res == None)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
| _ -> res == None) = | false | null | true | parse_tagged_union_eq pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
input;
match parse pk input with
| None -> ()
| Some (len, sz) ->
let input1 = Seq.slice input sz (Seq.length input) in
parse_bounded_vlgen_payload_unfold min max s len input1 | {
"checked_file": "LowParse.Spec.VLGen.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.VLData.fsti.checked",
"LowParse.Spec.Combinators.fsti.checked",
"LowParse.Spec.AllIntegers.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.VLGen.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.BoundedInt.bounded_int32",
"LowParse.Spec.Base.serializer",
"LowParse.Bytes.bytes",
"LowParse.Spec.Base.parse",
"LowParse.Spec.Base.consumed_length",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_unfold",
"FStar.Seq.Base.seq",
"LowParse.Bytes.byte",
"FStar.Seq.Base.slice",
"FStar.Seq.Base.length",
"Prims.unit",
"LowParse.Spec.Combinators.parse_tagged_union_eq",
"LowParse.Spec.VLData.parse_bounded_vldata_strong_t",
"LowParse.Spec.VLGen.tag_of_bounded_vlgen_payload",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload_kind",
"LowParse.Spec.VLGen.parse_bounded_vlgen_payload",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.None",
"LowParse.Spec.FLData.parse_fldata_strong_t",
"FStar.UInt32.v",
"LowParse.Spec.FLData.parse_fldata_strong",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"LowParse.Spec.Base.serialize",
"FStar.Pervasives.Native.Some",
"FStar.Pervasives.Native.Mktuple2",
"Prims.op_Addition",
"LowParse.Spec.VLGen.parse_bounded_vlgen",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Spec.VLGen
include LowParse.Spec.Combinators
include LowParse.Spec.AllIntegers
include LowParse.Spec.VLData // for parse_bounded_vldata_strong_t
(* TODO: this module should deprecate and replace LowParse.Spec.VLData *)
module U32 = FStar.UInt32
module Seq = FStar.Seq
let tag_of_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(x: parse_bounded_vldata_strong_t min max s)
: GTot (bounded_int32 min max)
= U32.uint_to_t (Seq.length (serialize s x))
inline_for_extraction
let synth_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(x: parse_fldata_strong_t s (U32.v sz))
: Tot (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
= x
inline_for_extraction
let parse_bounded_vlgen_payload_kind
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
: Tot parser_kind
= [@inline_let]
let kmin = k.parser_kind_low in
[@inline_let]
let min' = if kmin > min then kmin else min in
[@inline_let]
let max' = match k.parser_kind_high with
| None -> max
| Some kmax -> if kmax < max then kmax else max
in
[@inline_let]
let max' = if max' < min' then min' else max' in
strong_parser_kind min' max' (
match k.parser_kind_metadata with
| Some ParserKindMetadataFail -> Some ParserKindMetadataFail
| _ -> None
)
let parse_bounded_vlgen_payload
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
: Tot (parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then fail_parser (parse_bounded_vlgen_payload_kind min max k) (refine_with_tag (tag_of_bounded_vlgen_payload min max s) sz)
else
weaken (parse_bounded_vlgen_payload_kind min max k)
(parse_fldata_strong s (U32.v sz)
`parse_synth`
synth_bounded_vlgen_payload min max s sz)
let parse_bounded_vlgen_payload_unfold
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(sz: bounded_int32 min max)
(input: bytes)
: Lemma
(parse (parse_bounded_vlgen_payload min max s sz) input == (match parse (parse_fldata_strong s (U32.v sz)) input with
| None -> None
| Some (x, consumed) -> Some (x, consumed)
))
= let bounds_off =
k.parser_kind_low > U32.v sz || (
match k.parser_kind_high with
| None -> false
| Some kmax -> kmax < U32.v sz
)
in
if bounds_off
then ()
else
parse_synth_eq
(parse_fldata_strong s (U32.v sz))
(synth_bounded_vlgen_payload min max s sz)
input
inline_for_extraction
let parse_bounded_vlgen_kind
(sk: parser_kind)
(min: nat)
(max: nat { min <= max } )
(k: parser_kind)
= and_then_kind sk (parse_bounded_vlgen_payload_kind min max k)
let parse_bounded_vlgen
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
: Tot (parser (parse_bounded_vlgen_kind sk min max k) (parse_bounded_vldata_strong_t min max s))
= parse_tagged_union
pk
(tag_of_bounded_vlgen_payload min max s)
(parse_bounded_vlgen_payload min max s)
let parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat { min <= max /\ max < 4294967296 } )
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
begin
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\
res == Some (x, sz + U32.v len)
| _ -> res == None
end | false | false | LowParse.Spec.VLGen.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val parse_bounded_vlgen_unfold_aux
(min: nat)
(max: nat{min <= max /\ max < 4294967296})
(#sk: parser_kind)
(pk: parser sk (bounded_int32 min max))
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(input: bytes)
: Lemma
(let res = parse (parse_bounded_vlgen min max pk s) input in
match parse pk input with
| None -> res == None
| Some (len, sz) ->
let input' = Seq.slice input sz (Seq.length input) in
match parse (parse_fldata_strong s (U32.v len)) input' with
| Some (x, consumed_x) ->
Seq.length (serialize s x) = U32.v len /\ res == Some (x, sz + U32.v len)
| _ -> res == None) | [] | LowParse.Spec.VLGen.parse_bounded_vlgen_unfold_aux | {
"file_name": "src/lowparse/LowParse.Spec.VLGen.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
min: Prims.nat ->
max: Prims.nat{min <= max /\ max < 4294967296} ->
pk: LowParse.Spec.Base.parser sk (LowParse.Spec.BoundedInt.bounded_int32 min max) ->
s: LowParse.Spec.Base.serializer p ->
input: LowParse.Bytes.bytes
-> FStar.Pervasives.Lemma
(ensures
(let res =
LowParse.Spec.Base.parse (LowParse.Spec.VLGen.parse_bounded_vlgen min max pk s) input
in
(match LowParse.Spec.Base.parse pk input with
| FStar.Pervasives.Native.None #_ -> res == FStar.Pervasives.Native.None
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ len sz) ->
let input' = FStar.Seq.Base.slice input sz (FStar.Seq.Base.length input) in
(match
LowParse.Spec.Base.parse (LowParse.Spec.FLData.parse_fldata_strong s
(FStar.UInt32.v len))
input'
with
| FStar.Pervasives.Native.Some #_ (FStar.Pervasives.Native.Mktuple2 #_ #_ x _) ->
FStar.Seq.Base.length (LowParse.Spec.Base.serialize s x) = FStar.UInt32.v len /\
res == FStar.Pervasives.Native.Some (x, sz + FStar.UInt32.v len)
| _ -> res == FStar.Pervasives.Native.None)
<:
Type0)
<:
Type0)) | {
"end_col": 59,
"end_line": 167,
"start_col": 2,
"start_line": 158
} |
Prims.Tot | val two_map (#a #b: Type) (f: (a -> b)) (x: two a) : two b | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1) | val two_map (#a #b: Type) (f: (a -> b)) (x: two a) : two b
let two_map (#a #b: Type) (f: (a -> b)) (x: two a) : two b = | false | null | false | let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1) | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.Mktwo"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_map (#a #b: Type) (f: (a -> b)) (x: two a) : two b | [] | Vale.Def.Words.Two_s.two_map | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: (_: a -> b) -> x: Vale.Def.Words_s.two a -> Vale.Def.Words_s.two b | {
"end_col": 21,
"end_line": 7,
"start_col": 62,
"start_line": 5
} |
Prims.Tot | val two_reverse (#a: Type) (x: two a) : two a | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_reverse (#a:Type) (x:two a) : two a =
let Mktwo x0 x1 = x in
Mktwo x1 x0 | val two_reverse (#a: Type) (x: two a) : two a
let two_reverse (#a: Type) (x: two a) : two a = | false | null | false | let Mktwo x0 x1 = x in
Mktwo x1 x0 | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.Mktwo"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1)
let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n
unfold
let two_to_nat_unfold (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1)
let two_to_nat (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
two_to_nat_unfold size x
let two_select (#a:Type) (x:two a) (selector:nat1) : a =
match selector with
| 0 -> x.lo
| 1 -> x.hi
let two_insert (#a:Type) (x:two a) (y:a) (selector:nat1) : two a =
match selector with
| 0 -> Mktwo y x.hi
| 1 -> Mktwo x.lo y | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_reverse (#a: Type) (x: two a) : two a | [] | Vale.Def.Words.Two_s.two_reverse | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.Def.Words_s.two a -> Vale.Def.Words_s.two a | {
"end_col": 13,
"end_line": 45,
"start_col": 45,
"start_line": 43
} |
Prims.Tot | val two_map2 (#a #b: Type) (f: (a -> a -> b)) (x y: two a) : two b | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1) | val two_map2 (#a #b: Type) (f: (a -> a -> b)) (x y: two a) : two b
let two_map2 (#a #b: Type) (f: (a -> a -> b)) (x y: two a) : two b = | false | null | false | let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1) | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.Mktwo"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1) | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_map2 (#a #b: Type) (f: (a -> a -> b)) (x y: two a) : two b | [] | Vale.Def.Words.Two_s.two_map2 | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: (_: a -> _: a -> b) -> x: Vale.Def.Words_s.two a -> y: Vale.Def.Words_s.two a
-> Vale.Def.Words_s.two b | {
"end_col": 27,
"end_line": 12,
"start_col": 70,
"start_line": 9
} |
Prims.Tot | val two_select (#a: Type) (x: two a) (selector: nat1) : a | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_select (#a:Type) (x:two a) (selector:nat1) : a =
match selector with
| 0 -> x.lo
| 1 -> x.hi | val two_select (#a: Type) (x: two a) (selector: nat1) : a
let two_select (#a: Type) (x: two a) (selector: nat1) : a = | false | null | false | match selector with
| 0 -> x.lo
| 1 -> x.hi | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.nat1",
"Vale.Def.Words_s.__proj__Mktwo__item__lo",
"Vale.Def.Words_s.__proj__Mktwo__item__hi"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1)
let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n
unfold
let two_to_nat_unfold (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1)
let two_to_nat (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
two_to_nat_unfold size x | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_select (#a: Type) (x: two a) (selector: nat1) : a | [] | Vale.Def.Words.Two_s.two_select | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.Def.Words_s.two a -> selector: Vale.Def.Words_s.nat1 -> a | {
"end_col": 13,
"end_line": 36,
"start_col": 2,
"start_line": 34
} |
Prims.Tot | val two_insert (#a: Type) (x: two a) (y: a) (selector: nat1) : two a | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_insert (#a:Type) (x:two a) (y:a) (selector:nat1) : two a =
match selector with
| 0 -> Mktwo y x.hi
| 1 -> Mktwo x.lo y | val two_insert (#a: Type) (x: two a) (y: a) (selector: nat1) : two a
let two_insert (#a: Type) (x: two a) (y: a) (selector: nat1) : two a = | false | null | false | match selector with
| 0 -> Mktwo y x.hi
| 1 -> Mktwo x.lo y | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.nat1",
"Vale.Def.Words_s.Mktwo",
"Vale.Def.Words_s.__proj__Mktwo__item__hi",
"Vale.Def.Words_s.__proj__Mktwo__item__lo"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1)
let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n
unfold
let two_to_nat_unfold (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1)
let two_to_nat (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
two_to_nat_unfold size x
let two_select (#a:Type) (x:two a) (selector:nat1) : a =
match selector with
| 0 -> x.lo
| 1 -> x.hi | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_insert (#a: Type) (x: two a) (y: a) (selector: nat1) : two a | [] | Vale.Def.Words.Two_s.two_insert | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Vale.Def.Words_s.two a -> y: a -> selector: Vale.Def.Words_s.nat1 -> Vale.Def.Words_s.two a | {
"end_col": 21,
"end_line": 41,
"start_col": 2,
"start_line": 39
} |
Prims.Tot | val nat_to_two (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n | val nat_to_two (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size))
let nat_to_two (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) = | false | null | false | nat_to_two_unfold size n | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Prims.nat",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"FStar.Mul.op_Star",
"Vale.Def.Words.Two_s.nat_to_two_unfold",
"Vale.Def.Words_s.two"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1) | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val nat_to_two (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) | [] | Vale.Def.Words.Two_s.nat_to_two | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | size: Prims.nat -> n: Vale.Def.Words_s.natN (Prims.pow2 (2 * size))
-> Vale.Def.Words_s.two (Vale.Def.Words_s.natN (Prims.pow2 size)) | {
"end_col": 26,
"end_line": 21,
"start_col": 2,
"start_line": 21
} |
Prims.Tot | val two_to_nat (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_to_nat (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
two_to_nat_unfold size x | val two_to_nat (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size))
let two_to_nat (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) = | false | null | false | two_to_nat_unfold size x | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Prims.nat",
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Def.Words.Two_s.two_to_nat_unfold",
"FStar.Mul.op_Star"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1)
let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n
unfold
let two_to_nat_unfold (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1) | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_to_nat (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) | [] | Vale.Def.Words.Two_s.two_to_nat | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | size: Prims.nat -> x: Vale.Def.Words_s.two (Vale.Def.Words_s.natN (Prims.pow2 size))
-> Vale.Def.Words_s.natN (Prims.pow2 (2 * size)) | {
"end_col": 26,
"end_line": 31,
"start_col": 2,
"start_line": 31
} |
Prims.Tot | val two_to_nat_unfold (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let two_to_nat_unfold (size:nat) (x:two (natN (pow2 size))) : natN (pow2 (2 * size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1) | val two_to_nat_unfold (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size))
let two_to_nat_unfold (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) = | false | null | false | let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
let Mktwo x0 x1 = x in
int_to_natN n2 (x0 + x1 * n1) | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Prims.nat",
"Vale.Def.Words_s.two",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"Vale.Def.Words_s.int_to_natN",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.pos",
"Vale.Def.Words_s.pow2_norm"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1)
unfold
let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1)
let nat_to_two (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
nat_to_two_unfold size n | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val two_to_nat_unfold (size: nat) (x: two (natN (pow2 size))) : natN (pow2 (2 * size)) | [] | Vale.Def.Words.Two_s.two_to_nat_unfold | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | size: Prims.nat -> x: Vale.Def.Words_s.two (Vale.Def.Words_s.natN (Prims.pow2 size))
-> Vale.Def.Words_s.natN (Prims.pow2 (2 * size)) | {
"end_col": 31,
"end_line": 28,
"start_col": 86,
"start_line": 24
} |
Prims.Tot | val nat_to_two_unfold (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let nat_to_two_unfold (size:nat) (n:natN (pow2 (2 * size))) : two (natN (pow2 size)) =
let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1) | val nat_to_two_unfold (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size))
let nat_to_two_unfold (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) = | false | null | false | let n1 = pow2_norm size in
let n2 = pow2_norm (2 * size) in
Mktwo (n % n1) ((n / n1) % n1) | {
"checked_file": "Vale.Def.Words.Two_s.fsti.checked",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Def.Words.Two_s.fsti"
} | [
"total"
] | [
"Prims.nat",
"Vale.Def.Words_s.natN",
"Prims.pow2",
"FStar.Mul.op_Star",
"Vale.Def.Words_s.Mktwo",
"Prims.op_Modulus",
"Prims.op_Division",
"Prims.pos",
"Vale.Def.Words_s.pow2_norm",
"Vale.Def.Words_s.two"
] | [] | module Vale.Def.Words.Two_s
open Vale.Def.Words_s
open FStar.Mul
unfold let two_map (#a #b:Type) (f:a -> b) (x:two a) : two b =
let Mktwo x0 x1 = x in
Mktwo (f x0) (f x1)
unfold let two_map2 (#a #b:Type) (f:a -> a -> b) (x y:two a) : two b =
let Mktwo x0 x1 = x in
let Mktwo y0 y1 = y in
Mktwo (f x0 y0) (f x1 y1) | false | false | Vale.Def.Words.Two_s.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val nat_to_two_unfold (size: nat) (n: natN (pow2 (2 * size))) : two (natN (pow2 size)) | [] | Vale.Def.Words.Two_s.nat_to_two_unfold | {
"file_name": "vale/specs/defs/Vale.Def.Words.Two_s.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | size: Prims.nat -> n: Vale.Def.Words_s.natN (Prims.pow2 (2 * size))
-> Vale.Def.Words_s.two (Vale.Def.Words_s.natN (Prims.pow2 size)) | {
"end_col": 32,
"end_line": 18,
"start_col": 86,
"start_line": 15
} |
Prims.Tot | val array (a:Type0) : Type0 | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"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
}
] | false | let array a = ref (seq a) | val array (a:Type0) : Type0
let array a = | false | null | false | ref (seq a) | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [
"total"
] | [
"FStar.ST.ref",
"FStar.Seq.Base.seq"
] | [] | (*
Copyright 2008-2014 Nikhil Swamy and 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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref | false | true | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val array (a:Type0) : Type0 | [] | FStar.Array.array | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: Type0 -> Type0 | {
"end_col": 25,
"end_line": 28,
"start_col": 14,
"start_line": 28
} |
Prims.GTot | val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a)) | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"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
}
] | false | let as_ref #_ arr = arr | val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a))
let as_ref #_ arr = | false | null | false | arr | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [
"sometrivial"
] | [
"FStar.Array.array",
"FStar.ST.ref",
"FStar.Seq.Base.seq"
] | [] | (*
Copyright 2008-2014 Nikhil Swamy and 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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a) | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val as_ref (#a:Type0) (arr:array a) : GTot (ref (seq a)) | [] | FStar.Array.as_ref | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | arr: FStar.Array.array a -> Prims.GTot (FStar.ST.ref (FStar.Seq.Base.seq a)) | {
"end_col": 23,
"end_line": 30,
"start_col": 20,
"start_line": 30
} |
FStar.ST.ST | val of_list (#a:Type0) (l:list a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post (seq_of_list l)) | [
{
"abbrev": false,
"full_module": "FStar.Ref",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.All",
"short_module": null
},
{
"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
}
] | false | let of_list #a l = of_seq (Seq.seq_of_list l) | val of_list (#a:Type0) (l:list a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post (seq_of_list l))
let of_list #a l = | true | null | false | of_seq (Seq.seq_of_list l) | {
"checked_file": "FStar.Array.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.ST.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Ref.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.All.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Array.fst"
} | [] | [
"Prims.list",
"FStar.Array.of_seq",
"FStar.Seq.Properties.seq_of_list",
"FStar.Array.array"
] | [] | (*
Copyright 2008-2014 Nikhil Swamy and 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.
*)
(**
F* standard library mutable arrays module.
@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref
let array a = ref (seq a)
let as_ref #_ arr = arr
let op_At_Bar #a s1 s2 =
let s1' = !s1 in
let s2' = !s2 in
ST.alloc (Seq.append s1' s2')
let of_seq #a s = ST.alloc s
let to_seq #a s = !s | false | false | FStar.Array.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val of_list (#a:Type0) (l:list a)
: ST (array a)
(requires fun _ -> True)
(ensures create_post (seq_of_list l)) | [] | FStar.Array.of_list | {
"file_name": "ulib/legacy/FStar.Array.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | l: Prims.list a -> FStar.ST.ST (FStar.Array.array a) | {
"end_col": 45,
"end_line": 41,
"start_col": 19,
"start_line": 41
} |