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 bn_to_bytes_le: Hacl.Bignum.Convert.bn_to_bytes_le_st t_limbs n_bytes | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bn_to_bytes_le = Hacl.Bignum.Convert.mk_bn_to_bytes_le true n_bytes | val bn_to_bytes_le: Hacl.Bignum.Convert.bn_to_bytes_le_st t_limbs n_bytes
let bn_to_bytes_le = | false | null | false | Hacl.Bignum.Convert.mk_bn_to_bytes_le true n_bytes | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Convert.mk_bn_to_bytes_le",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_bytes"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res
let new_bn_from_bytes_be = BS.new_bn_from_bytes_be
let new_bn_from_bytes_le = BS.new_bn_from_bytes_le
let bn_to_bytes_be = Hacl.Bignum.Convert.mk_bn_to_bytes_be true n_bytes | false | true | Hacl.Bignum4096_32.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val bn_to_bytes_le: Hacl.Bignum.Convert.bn_to_bytes_le_st t_limbs n_bytes | [] | Hacl.Bignum4096_32.bn_to_bytes_le | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Convert.bn_to_bytes_le_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_bytes | {
"end_col": 71,
"end_line": 171,
"start_col": 21,
"start_line": 171
} |
Prims.Tot | val bn_to_bytes_be: Hacl.Bignum.Convert.bn_to_bytes_be_st t_limbs n_bytes | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bn_to_bytes_be = Hacl.Bignum.Convert.mk_bn_to_bytes_be true n_bytes | val bn_to_bytes_be: Hacl.Bignum.Convert.bn_to_bytes_be_st t_limbs n_bytes
let bn_to_bytes_be = | false | null | false | Hacl.Bignum.Convert.mk_bn_to_bytes_be true n_bytes | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Convert.mk_bn_to_bytes_be",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_bytes"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res
let new_bn_from_bytes_be = BS.new_bn_from_bytes_be
let new_bn_from_bytes_le = BS.new_bn_from_bytes_le | false | true | Hacl.Bignum4096_32.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val bn_to_bytes_be: Hacl.Bignum.Convert.bn_to_bytes_be_st t_limbs n_bytes | [] | Hacl.Bignum4096_32.bn_to_bytes_be | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Convert.bn_to_bytes_be_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_bytes | {
"end_col": 71,
"end_line": 169,
"start_col": 21,
"start_line": 169
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.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 u256 = b:B.buffer UInt64.t{B.length b == 4} | let u256 = | false | null | false | b: B.buffer UInt64.t {B.length b == 4} | {
"checked_file": "Vale.Inline.X64.Fswap_inline.fsti.checked",
"dependencies": [
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Inline.X64.Fswap_inline.fsti"
} | [
"total"
] | [
"LowStar.Buffer.buffer",
"FStar.UInt64.t",
"Prims.eq2",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder"
] | [] | module Vale.Inline.X64.Fswap_inline
open Vale.X64.CPU_Features_s
open FStar.HyperStack.ST
module B = LowStar.Buffer
module HS = FStar.HyperStack
open Vale.Curve25519.Fast_defs
open FStar.Mul | false | true | Vale.Inline.X64.Fswap_inline.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 u256 : Type0 | [] | Vale.Inline.X64.Fswap_inline.u256 | {
"file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fswap_inline.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 47,
"end_line": 11,
"start_col": 11,
"start_line": 11
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.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 u512 = b:B.buffer UInt64.t{B.length b == 8} | let u512 = | false | null | false | b: B.buffer UInt64.t {B.length b == 8} | {
"checked_file": "Vale.Inline.X64.Fswap_inline.fsti.checked",
"dependencies": [
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Inline.X64.Fswap_inline.fsti"
} | [
"total"
] | [
"LowStar.Buffer.buffer",
"FStar.UInt64.t",
"Prims.eq2",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder"
] | [] | module Vale.Inline.X64.Fswap_inline
open Vale.X64.CPU_Features_s
open FStar.HyperStack.ST
module B = LowStar.Buffer
module HS = FStar.HyperStack
open Vale.Curve25519.Fast_defs
open FStar.Mul
unfold
let u256 = b:B.buffer UInt64.t{B.length b == 4} | false | true | Vale.Inline.X64.Fswap_inline.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 u512 : Type0 | [] | Vale.Inline.X64.Fswap_inline.u512 | {
"file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fswap_inline.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 47,
"end_line": 13,
"start_col": 11,
"start_line": 13
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.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 u1024 = b:B.buffer UInt64.t{B.length b == 16} | let u1024 = | false | null | false | b: B.buffer UInt64.t {B.length b == 16} | {
"checked_file": "Vale.Inline.X64.Fswap_inline.fsti.checked",
"dependencies": [
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Inline.X64.Fswap_inline.fsti"
} | [
"total"
] | [
"LowStar.Buffer.buffer",
"FStar.UInt64.t",
"Prims.eq2",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder"
] | [] | module Vale.Inline.X64.Fswap_inline
open Vale.X64.CPU_Features_s
open FStar.HyperStack.ST
module B = LowStar.Buffer
module HS = FStar.HyperStack
open Vale.Curve25519.Fast_defs
open FStar.Mul
unfold
let u256 = b:B.buffer UInt64.t{B.length b == 4}
unfold
let u512 = b:B.buffer UInt64.t{B.length b == 8} | false | true | Vale.Inline.X64.Fswap_inline.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 u1024 : Type0 | [] | Vale.Inline.X64.Fswap_inline.u1024 | {
"file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fswap_inline.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 49,
"end_line": 15,
"start_col": 12,
"start_line": 15
} |
|
Prims.GTot | val as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Curve25519.Fast_defs",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Inline.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_nat (b:B.buffer UInt64.t{B.length b == 4}) (h:HS.mem) : GTot nat =
let s = B.as_seq h b in
let s0 = UInt64.v (Seq.index s 0) in
let s1 = UInt64.v (Seq.index s 1) in
let s2 = UInt64.v (Seq.index s 2) in
let s3 = UInt64.v (Seq.index s 3) in
pow2_four s0 s1 s2 s3 | val as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat
let as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat = | false | null | false | let s = B.as_seq h b in
let s0 = UInt64.v (Seq.index s 0) in
let s1 = UInt64.v (Seq.index s 1) in
let s2 = UInt64.v (Seq.index s 2) in
let s3 = UInt64.v (Seq.index s 3) in
pow2_four s0 s1 s2 s3 | {
"checked_file": "Vale.Inline.X64.Fswap_inline.fsti.checked",
"dependencies": [
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Curve25519.Fast_defs.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Inline.X64.Fswap_inline.fsti"
} | [
"sometrivial"
] | [
"LowStar.Buffer.buffer",
"FStar.UInt64.t",
"Prims.eq2",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"FStar.Monotonic.HyperStack.mem",
"Vale.Curve25519.Fast_defs.pow2_four",
"FStar.UInt.uint_t",
"FStar.UInt64.v",
"FStar.Seq.Base.index",
"FStar.Seq.Base.seq",
"LowStar.Monotonic.Buffer.as_seq",
"Prims.nat"
] | [] | module Vale.Inline.X64.Fswap_inline
open Vale.X64.CPU_Features_s
open FStar.HyperStack.ST
module B = LowStar.Buffer
module HS = FStar.HyperStack
open Vale.Curve25519.Fast_defs
open FStar.Mul
unfold
let u256 = b:B.buffer UInt64.t{B.length b == 4}
unfold
let u512 = b:B.buffer UInt64.t{B.length b == 8}
unfold
let u1024 = b:B.buffer UInt64.t{B.length b == 16} | false | false | Vale.Inline.X64.Fswap_inline.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_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat | [] | Vale.Inline.X64.Fswap_inline.as_nat | {
"file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fswap_inline.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
b: LowStar.Buffer.buffer FStar.UInt64.t {LowStar.Monotonic.Buffer.length b == 4} ->
h: FStar.Monotonic.HyperStack.mem
-> Prims.GTot Prims.nat | {
"end_col": 23,
"end_line": 23,
"start_col": 73,
"start_line": 17
} |
FStar.HyperStack.ST.Stack | val point_negate: p:F51.point -> out:F51.point ->
Stack unit
(requires fun h ->
live h out /\ live h p /\ disjoint out p /\
F51.point_inv_t h p)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let (x1, y1, z1, t1) = F51.point_eval h0 p in
F51.point_inv_t h1 out /\
F51.point_eval h1 out == SC.((-x1) % prime, y1, z1, (-t1) % prime))) | [
{
"abbrev": true,
"full_module": "Spec.Curve25519",
"short_module": "SC"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Ed25519.Field51",
"short_module": "F51"
},
{
"abbrev": false,
"full_module": "Hacl.Bignum25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Ed25519",
"short_module": null
},
{
"abbrev": 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 point_negate p out =
push_frame ();
let zero = create 5ul (u64 0) in
make_zero zero;
let x = getx p in
let y = gety p in
let z = getz p in
let t = gett p in
let x1 = getx out in
let y1 = gety out in
let z1 = getz out in
let t1 = gett out in
fdifference x1 zero x;
reduce_513 x1;
copy y1 y;
copy z1 z;
fdifference t1 zero t;
reduce_513 t1;
pop_frame () | val point_negate: p:F51.point -> out:F51.point ->
Stack unit
(requires fun h ->
live h out /\ live h p /\ disjoint out p /\
F51.point_inv_t h p)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let (x1, y1, z1, t1) = F51.point_eval h0 p in
F51.point_inv_t h1 out /\
F51.point_eval h1 out == SC.((-x1) % prime, y1, z1, (-t1) % prime)))
let point_negate p out = | true | null | false | push_frame ();
let zero = create 5ul (u64 0) in
make_zero zero;
let x = getx p in
let y = gety p in
let z = getz p in
let t = gett p in
let x1 = getx out in
let y1 = gety out in
let z1 = getz out in
let t1 = gett out in
fdifference x1 zero x;
reduce_513 x1;
copy y1 y;
copy z1 z;
fdifference t1 zero t;
reduce_513 t1;
pop_frame () | {
"checked_file": "Hacl.Impl.Ed25519.PointNegate.fst.checked",
"dependencies": [
"Spec.Curve25519.fst.checked",
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Impl.Ed25519.Field51.fst.checked",
"Hacl.Bignum25519.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Ed25519.PointNegate.fst"
} | [] | [
"Hacl.Impl.Ed25519.Field51.point",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Hacl.Bignum25519.reduce_513",
"Hacl.Bignum25519.fdifference",
"Lib.Buffer.copy",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint64",
"FStar.UInt32.__uint_to_t",
"Hacl.Bignum25519.felem",
"Hacl.Bignum25519.gett",
"Hacl.Bignum25519.getz",
"Hacl.Bignum25519.gety",
"Hacl.Bignum25519.getx",
"Hacl.Bignum25519.make_zero",
"Lib.Buffer.lbuffer_t",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Lib.Buffer.create",
"Lib.IntTypes.u64",
"Lib.Buffer.lbuffer",
"FStar.HyperStack.ST.push_frame"
] | [] | module Hacl.Impl.Ed25519.PointNegate
module ST = FStar.HyperStack.ST
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Buffer
open Hacl.Bignum25519
module F51 = Hacl.Impl.Ed25519.Field51
module SC = Spec.Curve25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
val point_negate: p:F51.point -> out:F51.point ->
Stack unit
(requires fun h ->
live h out /\ live h p /\ disjoint out p /\
F51.point_inv_t h p)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let (x1, y1, z1, t1) = F51.point_eval h0 p in
F51.point_inv_t h1 out /\
F51.point_eval h1 out == SC.((-x1) % prime, y1, z1, (-t1) % prime))) | false | false | Hacl.Impl.Ed25519.PointNegate.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val point_negate: p:F51.point -> out:F51.point ->
Stack unit
(requires fun h ->
live h out /\ live h p /\ disjoint out p /\
F51.point_inv_t h p)
(ensures fun h0 _ h1 -> modifies (loc out) h0 h1 /\
(let (x1, y1, z1, t1) = F51.point_eval h0 p in
F51.point_inv_t h1 out /\
F51.point_eval h1 out == SC.((-x1) % prime, y1, z1, (-t1) % prime))) | [] | Hacl.Impl.Ed25519.PointNegate.point_negate | {
"file_name": "code/ed25519/Hacl.Impl.Ed25519.PointNegate.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | p: Hacl.Impl.Ed25519.Field51.point -> out: Hacl.Impl.Ed25519.Field51.point
-> FStar.HyperStack.ST.Stack Prims.unit | {
"end_col": 14,
"end_line": 46,
"start_col": 2,
"start_line": 27
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Pulse.Typing.Metatheory",
"short_module": "Metatheory"
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": true,
"full_module": "Pulse.Typing.FV",
"short_module": "FV"
},
{
"abbrev": false,
"full_module": "Pulse.Typing.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing",
"short_module": "RT"
},
{
"abbrev": false,
"full_module": "Pulse.Checker",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker",
"short_module": null
},
{
"abbrev": 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 checker_result_inv (g:env) (post_hint:post_hint_opt g)
(x:var)
(g1:env)
(t:(u:universe & t:term & universe_of g1 t u))
(ctxt':(ctxt':vprop & tot_typing g1 ctxt' tm_vprop)) =
let (| _, t, _ |) = t in
let (| ctxt', _ |) = ctxt' in
checker_res_matches_post_hint g post_hint x t ctxt' /\
lookup g1 x == Some t | let checker_result_inv
(g: env)
(post_hint: post_hint_opt g)
(x: var)
(g1: env)
(t: (u: universe & t: term & universe_of g1 t u))
(ctxt': (ctxt': vprop & tot_typing g1 ctxt' tm_vprop))
= | false | null | false | let (| _ , t , _ |) = t in
let (| ctxt' , _ |) = ctxt' in
checker_res_matches_post_hint g post_hint x t ctxt' /\ lookup g1 x == Some t | {
"checked_file": "Pulse.Checker.Base.fsti.checked",
"dependencies": [
"Pulse.Typing.Metatheory.fsti.checked",
"Pulse.Typing.FV.fsti.checked",
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Pulse.Checker.Base.fsti"
} | [
"total"
] | [
"Pulse.Typing.Env.env",
"Pulse.Typing.post_hint_opt",
"Pulse.Syntax.Base.var",
"FStar.Pervasives.dtuple3",
"Pulse.Syntax.Base.universe",
"Pulse.Syntax.Base.term",
"Pulse.Typing.universe_of",
"Prims.dtuple2",
"Pulse.Syntax.Base.vprop",
"Pulse.Typing.tot_typing",
"Pulse.Syntax.Base.tm_vprop",
"Prims.l_and",
"Pulse.Checker.Base.checker_res_matches_post_hint",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"Pulse.Syntax.Base.typ",
"Pulse.Typing.Env.lookup",
"FStar.Pervasives.Native.Some",
"Prims.logical"
] | [] | module Pulse.Checker.Base
module RT = FStar.Reflection.Typing
module R = FStar.Reflection.V2
module L = FStar.List.Tot
module T = FStar.Tactics.V2
open FStar.List.Tot
open Pulse.Syntax
open Pulse.Typing
open Pulse.Typing.Combinators
module FV = Pulse.Typing.FV
module RU = Pulse.RuntimeUtils
module Metatheory = Pulse.Typing.Metatheory
val format_failed_goal (g:env) (ctxt:list term) (goal:list term) : T.Tac string
val intro_post_hint (g:env) (ctag_opt:option ctag) (ret_ty:option term) (post:term)
: T.Tac (post_hint_for_env g)
val post_hint_from_comp_typing (#g:env) (#c:comp_st) (ct:Metatheory.comp_typing_u g c)
: post_hint_for_env g
type continuation_elaborator
(g:env) (ctxt:vprop)
(g':env { g' `env_extends` g }) (ctxt':vprop) =
post_hint:post_hint_opt g ->
st_typing_in_ctxt g' ctxt' post_hint ->
T.Tac (st_typing_in_ctxt g ctxt post_hint)
val k_elab_unit (g:env) (ctxt:term)
: continuation_elaborator g ctxt g ctxt
val k_elab_trans
(#g0:env) (#g1:env { g1 `env_extends` g0 }) (#g2:env { g2 `env_extends` g1 }) (#ctxt0 #ctxt1 #ctxt2:term)
(k0:continuation_elaborator g0 ctxt0 g1 ctxt1)
(k1:continuation_elaborator g1 ctxt1 g2 ctxt2 { g1 `env_extends` g0})
: continuation_elaborator g0 ctxt0 g2 ctxt2
val k_elab_equiv
(#g1:env) (#g2:env { g2 `env_extends` g1 }) (#ctxt1 #ctxt1' #ctxt2 #ctxt2':term)
(k:continuation_elaborator g1 ctxt1 g2 ctxt2)
(d1:vprop_equiv g1 ctxt1 ctxt1')
(d2:vprop_equiv g2 ctxt2 ctxt2')
: continuation_elaborator g1 ctxt1' g2 ctxt2'
//
// A canonical continuation elaborator for Bind
//
val continuation_elaborator_with_bind (#g:env) (ctxt:term)
(#c1:comp{stateful_comp c1})
(#e1:st_term)
(e1_typing:st_typing g e1 c1)
(ctxt_pre1_typing:tot_typing g (tm_star ctxt (comp_pre c1)) tm_vprop)
(x:nvar { None? (lookup g (snd x)) })
: T.Tac (continuation_elaborator
g
(tm_star ctxt (comp_pre c1))
(push_binding g (snd x) (fst x) (comp_res c1))
(tm_star (open_term (comp_post c1) (snd x)) ctxt))
val continuation_elaborator_with_let (#g:env) (#ctxt:term)
(ctxt_typing:tot_typing g ctxt tm_vprop)
(#e1:term)
(#eff1:T.tot_or_ghost)
(#t1:term)
(b:binder{b.binder_ty == t1})
(e1_typing:typing g e1 eff1 t1)
(x:nvar { None? (lookup g (snd x)) })
: T.Tac (continuation_elaborator
g ctxt
(push_binding g (snd x) ppname_default t1) ctxt)
val check_equiv_emp (g:env) (vp:term)
: option (vprop_equiv g vp tm_emp)
let checker_res_matches_post_hint
(g:env)
(post_hint:post_hint_opt g)
(x:var) (t:term) (ctxt':vprop) =
match post_hint with
| None -> True
| Some post_hint ->
t == post_hint.ret_ty /\
ctxt' == open_term post_hint.post x
let checker_result_inv (g:env) (post_hint:post_hint_opt g)
(x:var)
(g1:env) | false | false | Pulse.Checker.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val checker_result_inv : g: Pulse.Typing.Env.env ->
post_hint: Pulse.Typing.post_hint_opt g ->
x: Pulse.Syntax.Base.var ->
g1: Pulse.Typing.Env.env ->
t:
FStar.Pervasives.dtuple3 Pulse.Syntax.Base.universe
(fun _ -> Pulse.Syntax.Base.term)
(fun u22 t -> Pulse.Typing.universe_of g1 t u22) ->
ctxt':
Prims.dtuple2 Pulse.Syntax.Base.vprop
(fun ctxt' -> Pulse.Typing.tot_typing g1 ctxt' Pulse.Syntax.Base.tm_vprop)
-> Prims.logical | [] | Pulse.Checker.Base.checker_result_inv | {
"file_name": "lib/steel/pulse/Pulse.Checker.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
g: Pulse.Typing.Env.env ->
post_hint: Pulse.Typing.post_hint_opt g ->
x: Pulse.Syntax.Base.var ->
g1: Pulse.Typing.Env.env ->
t:
FStar.Pervasives.dtuple3 Pulse.Syntax.Base.universe
(fun _ -> Pulse.Syntax.Base.term)
(fun u22 t -> Pulse.Typing.universe_of g1 t u22) ->
ctxt':
Prims.dtuple2 Pulse.Syntax.Base.vprop
(fun ctxt' -> Pulse.Typing.tot_typing g1 ctxt' Pulse.Syntax.Base.tm_vprop)
-> Prims.logical | {
"end_col": 23,
"end_line": 97,
"start_col": 56,
"start_line": 92
} |
|
Prims.Tot | [
{
"abbrev": true,
"full_module": "Pulse.Typing.Metatheory",
"short_module": "Metatheory"
},
{
"abbrev": true,
"full_module": "Pulse.RuntimeUtils",
"short_module": "RU"
},
{
"abbrev": true,
"full_module": "Pulse.Typing.FV",
"short_module": "FV"
},
{
"abbrev": false,
"full_module": "Pulse.Typing.Combinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Typing",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Syntax",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing",
"short_module": "RT"
},
{
"abbrev": false,
"full_module": "Pulse.Checker",
"short_module": null
},
{
"abbrev": false,
"full_module": "Pulse.Checker",
"short_module": null
},
{
"abbrev": 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 checker_res_matches_post_hint
(g:env)
(post_hint:post_hint_opt g)
(x:var) (t:term) (ctxt':vprop) =
match post_hint with
| None -> True
| Some post_hint ->
t == post_hint.ret_ty /\
ctxt' == open_term post_hint.post x | let checker_res_matches_post_hint
(g: env)
(post_hint: post_hint_opt g)
(x: var)
(t: term)
(ctxt': vprop)
= | false | null | false | match post_hint with
| None -> True
| Some post_hint -> t == post_hint.ret_ty /\ ctxt' == open_term post_hint.post x | {
"checked_file": "Pulse.Checker.Base.fsti.checked",
"dependencies": [
"Pulse.Typing.Metatheory.fsti.checked",
"Pulse.Typing.FV.fsti.checked",
"Pulse.Typing.Combinators.fsti.checked",
"Pulse.Typing.fst.checked",
"Pulse.Syntax.fst.checked",
"Pulse.RuntimeUtils.fsti.checked",
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Pulse.Checker.Base.fsti"
} | [
"total"
] | [
"Pulse.Typing.Env.env",
"Pulse.Typing.post_hint_opt",
"Pulse.Syntax.Base.var",
"Pulse.Syntax.Base.term",
"Pulse.Syntax.Base.vprop",
"Prims.l_True",
"Pulse.Typing.post_hint_t",
"Prims.l_and",
"Prims.eq2",
"Pulse.Typing.__proj__Mkpost_hint_t__item__ret_ty",
"Pulse.Syntax.Naming.open_term",
"Pulse.Typing.__proj__Mkpost_hint_t__item__post",
"Prims.logical"
] | [] | module Pulse.Checker.Base
module RT = FStar.Reflection.Typing
module R = FStar.Reflection.V2
module L = FStar.List.Tot
module T = FStar.Tactics.V2
open FStar.List.Tot
open Pulse.Syntax
open Pulse.Typing
open Pulse.Typing.Combinators
module FV = Pulse.Typing.FV
module RU = Pulse.RuntimeUtils
module Metatheory = Pulse.Typing.Metatheory
val format_failed_goal (g:env) (ctxt:list term) (goal:list term) : T.Tac string
val intro_post_hint (g:env) (ctag_opt:option ctag) (ret_ty:option term) (post:term)
: T.Tac (post_hint_for_env g)
val post_hint_from_comp_typing (#g:env) (#c:comp_st) (ct:Metatheory.comp_typing_u g c)
: post_hint_for_env g
type continuation_elaborator
(g:env) (ctxt:vprop)
(g':env { g' `env_extends` g }) (ctxt':vprop) =
post_hint:post_hint_opt g ->
st_typing_in_ctxt g' ctxt' post_hint ->
T.Tac (st_typing_in_ctxt g ctxt post_hint)
val k_elab_unit (g:env) (ctxt:term)
: continuation_elaborator g ctxt g ctxt
val k_elab_trans
(#g0:env) (#g1:env { g1 `env_extends` g0 }) (#g2:env { g2 `env_extends` g1 }) (#ctxt0 #ctxt1 #ctxt2:term)
(k0:continuation_elaborator g0 ctxt0 g1 ctxt1)
(k1:continuation_elaborator g1 ctxt1 g2 ctxt2 { g1 `env_extends` g0})
: continuation_elaborator g0 ctxt0 g2 ctxt2
val k_elab_equiv
(#g1:env) (#g2:env { g2 `env_extends` g1 }) (#ctxt1 #ctxt1' #ctxt2 #ctxt2':term)
(k:continuation_elaborator g1 ctxt1 g2 ctxt2)
(d1:vprop_equiv g1 ctxt1 ctxt1')
(d2:vprop_equiv g2 ctxt2 ctxt2')
: continuation_elaborator g1 ctxt1' g2 ctxt2'
//
// A canonical continuation elaborator for Bind
//
val continuation_elaborator_with_bind (#g:env) (ctxt:term)
(#c1:comp{stateful_comp c1})
(#e1:st_term)
(e1_typing:st_typing g e1 c1)
(ctxt_pre1_typing:tot_typing g (tm_star ctxt (comp_pre c1)) tm_vprop)
(x:nvar { None? (lookup g (snd x)) })
: T.Tac (continuation_elaborator
g
(tm_star ctxt (comp_pre c1))
(push_binding g (snd x) (fst x) (comp_res c1))
(tm_star (open_term (comp_post c1) (snd x)) ctxt))
val continuation_elaborator_with_let (#g:env) (#ctxt:term)
(ctxt_typing:tot_typing g ctxt tm_vprop)
(#e1:term)
(#eff1:T.tot_or_ghost)
(#t1:term)
(b:binder{b.binder_ty == t1})
(e1_typing:typing g e1 eff1 t1)
(x:nvar { None? (lookup g (snd x)) })
: T.Tac (continuation_elaborator
g ctxt
(push_binding g (snd x) ppname_default t1) ctxt)
val check_equiv_emp (g:env) (vp:term)
: option (vprop_equiv g vp tm_emp)
let checker_res_matches_post_hint
(g:env)
(post_hint:post_hint_opt g)
(x:var) (t:term) (ctxt':vprop) = | false | false | Pulse.Checker.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val checker_res_matches_post_hint : g: Pulse.Typing.Env.env ->
post_hint: Pulse.Typing.post_hint_opt g ->
x: Pulse.Syntax.Base.var ->
t: Pulse.Syntax.Base.term ->
ctxt': Pulse.Syntax.Base.vprop
-> Prims.logical | [] | Pulse.Checker.Base.checker_res_matches_post_hint | {
"file_name": "lib/steel/pulse/Pulse.Checker.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
g: Pulse.Typing.Env.env ->
post_hint: Pulse.Typing.post_hint_opt g ->
x: Pulse.Syntax.Base.var ->
t: Pulse.Syntax.Base.term ->
ctxt': Pulse.Syntax.Base.vprop
-> Prims.logical | {
"end_col": 39,
"end_line": 86,
"start_col": 2,
"start_line": 82
} |
|
FStar.Pervasives.Lemma | val pack_inspect_namedv (t:R.namedv)
: Lemma (ensures R.(pack_namedv (inspect_namedv t) == t))
[SMTPat R.(pack_namedv (inspect_namedv t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_namedv = R.pack_inspect_namedv | val pack_inspect_namedv (t:R.namedv)
: Lemma (ensures R.(pack_namedv (inspect_namedv t) == t))
[SMTPat R.(pack_namedv (inspect_namedv t))]
let pack_inspect_namedv = | false | null | true | R.pack_inspect_namedv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_namedv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv | false | false | FStar.Reflection.Typing.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 pack_inspect_namedv (t:R.namedv)
: Lemma (ensures R.(pack_namedv (inspect_namedv t) == t))
[SMTPat R.(pack_namedv (inspect_namedv t))] | [] | FStar.Reflection.Typing.pack_inspect_namedv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.namedv
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.pack_namedv (FStar.Reflection.V2.Builtins.inspect_namedv t) ==
t)
[
SMTPat (FStar.Reflection.V2.Builtins.pack_namedv (FStar.Reflection.V2.Builtins.inspect_namedv
t))
] | {
"end_col": 47,
"end_line": 39,
"start_col": 26,
"start_line": 39
} |
FStar.Pervasives.Lemma | val pack_inspect_comp (t:R.comp)
: Lemma (ensures (R.pack_comp (R.inspect_comp t) == t))
[SMTPat (R.pack_comp (R.inspect_comp t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_comp = R.pack_inspect_comp_inv | val pack_inspect_comp (t:R.comp)
: Lemma (ensures (R.pack_comp (R.inspect_comp t) == t))
[SMTPat (R.pack_comp (R.inspect_comp t))]
let pack_inspect_comp = | false | null | true | R.pack_inspect_comp_inv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_comp_inv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder | false | false | FStar.Reflection.Typing.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 pack_inspect_comp (t:R.comp)
: Lemma (ensures (R.pack_comp (R.inspect_comp t) == t))
[SMTPat (R.pack_comp (R.inspect_comp t))] | [] | FStar.Reflection.Typing.pack_inspect_comp | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.comp
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.pack_comp (FStar.Reflection.V2.Builtins.inspect_comp t) == t)
[
SMTPat (FStar.Reflection.V2.Builtins.pack_comp (FStar.Reflection.V2.Builtins.inspect_comp t)
)
] | {
"end_col": 47,
"end_line": 48,
"start_col": 24,
"start_line": 48
} |
FStar.Pervasives.Lemma | val inspect_pack (t:R.term_view)
: Lemma (ensures R.(inspect_ln (pack_ln t) == t))
[SMTPat R.(inspect_ln (pack_ln t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack = R.inspect_pack_inv | val inspect_pack (t:R.term_view)
: Lemma (ensures R.(inspect_ln (pack_ln t) == t))
[SMTPat R.(inspect_ln (pack_ln t))]
let inspect_pack = | false | null | true | R.inspect_pack_inv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_inv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack (t:R.term_view)
: Lemma (ensures R.(inspect_ln (pack_ln t) == t))
[SMTPat R.(inspect_ln (pack_ln t))] | [] | FStar.Reflection.Typing.inspect_pack | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.V2.Data.term_view
-> FStar.Pervasives.Lemma
(ensures FStar.Reflection.V2.Builtins.inspect_ln (FStar.Reflection.V2.Builtins.pack_ln t) == t
) [SMTPat (FStar.Reflection.V2.Builtins.inspect_ln (FStar.Reflection.V2.Builtins.pack_ln t))] | {
"end_col": 37,
"end_line": 35,
"start_col": 19,
"start_line": 35
} |
FStar.Pervasives.Lemma | val inspect_pack_binder (bview:R.binder_view)
: Lemma (ensures R.(R.inspect_binder (R.pack_binder bview) == bview))
[SMTPat R.(inspect_binder (pack_binder bview))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_binder = R.inspect_pack_binder | val inspect_pack_binder (bview:R.binder_view)
: Lemma (ensures R.(R.inspect_binder (R.pack_binder bview) == bview))
[SMTPat R.(inspect_binder (pack_binder bview))]
let inspect_pack_binder = | false | null | true | R.inspect_pack_binder | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_binder"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_binder (bview:R.binder_view)
: Lemma (ensures R.(R.inspect_binder (R.pack_binder bview) == bview))
[SMTPat R.(inspect_binder (pack_binder bview))] | [] | FStar.Reflection.Typing.inspect_pack_binder | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | bview: FStar.Reflection.V2.Data.binder_view
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.inspect_binder (FStar.Reflection.V2.Builtins.pack_binder bview) ==
bview)
[
SMTPat (FStar.Reflection.V2.Builtins.inspect_binder (FStar.Reflection.V2.Builtins.pack_binder
bview))
] | {
"end_col": 47,
"end_line": 44,
"start_col": 26,
"start_line": 44
} |
FStar.Pervasives.Lemma | val pack_inspect_binder (t:R.binder)
: Lemma (ensures (R.pack_binder (R.inspect_binder t) == t))
[SMTPat (R.pack_binder (R.inspect_binder t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_binder = R.pack_inspect_binder | val pack_inspect_binder (t:R.binder)
: Lemma (ensures (R.pack_binder (R.inspect_binder t) == t))
[SMTPat (R.pack_binder (R.inspect_binder t))]
let pack_inspect_binder = | false | null | true | R.pack_inspect_binder | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_binder"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv | false | false | FStar.Reflection.Typing.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 pack_inspect_binder (t:R.binder)
: Lemma (ensures (R.pack_binder (R.inspect_binder t) == t))
[SMTPat (R.pack_binder (R.inspect_binder t))] | [] | FStar.Reflection.Typing.pack_inspect_binder | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.binder
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.pack_binder (FStar.Reflection.V2.Builtins.inspect_binder t) ==
t)
[
SMTPat (FStar.Reflection.V2.Builtins.pack_binder (FStar.Reflection.V2.Builtins.inspect_binder
t))
] | {
"end_col": 47,
"end_line": 45,
"start_col": 26,
"start_line": 45
} |
FStar.Pervasives.Lemma | val inspect_pack_bv (t:R.bv_view)
: Lemma (ensures R.(inspect_bv (pack_bv t) == t))
[SMTPat R.(inspect_bv (pack_bv t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_bv = R.inspect_pack_bv | val inspect_pack_bv (t:R.bv_view)
: Lemma (ensures R.(inspect_bv (pack_bv t) == t))
[SMTPat R.(inspect_bv (pack_bv t))]
let inspect_pack_bv = | false | null | true | R.inspect_pack_bv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_bv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_bv (t:R.bv_view)
: Lemma (ensures R.(inspect_bv (pack_bv t) == t))
[SMTPat R.(inspect_bv (pack_bv t))] | [] | FStar.Reflection.Typing.inspect_pack_bv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.V2.Data.bv_view
-> FStar.Pervasives.Lemma
(ensures FStar.Reflection.V2.Builtins.inspect_bv (FStar.Reflection.V2.Builtins.pack_bv t) == t
) [SMTPat (FStar.Reflection.V2.Builtins.inspect_bv (FStar.Reflection.V2.Builtins.pack_bv t))] | {
"end_col": 39,
"end_line": 41,
"start_col": 22,
"start_line": 41
} |
FStar.Pervasives.Lemma | val inspect_pack_universe (u:R.universe_view)
: Lemma (ensures R.inspect_universe (R.pack_universe u) == u)
[SMTPat (R.inspect_universe (R.pack_universe u))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_universe = R.inspect_pack_universe | val inspect_pack_universe (u:R.universe_view)
: Lemma (ensures R.inspect_universe (R.pack_universe u) == u)
[SMTPat (R.inspect_universe (R.pack_universe u))]
let inspect_pack_universe = | false | null | true | R.inspect_pack_universe | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_universe"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_universe (u:R.universe_view)
: Lemma (ensures R.inspect_universe (R.pack_universe u) == u)
[SMTPat (R.inspect_universe (R.pack_universe u))] | [] | FStar.Reflection.Typing.inspect_pack_universe | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | u27: FStar.Reflection.V2.Data.universe_view
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.inspect_universe (FStar.Reflection.V2.Builtins.pack_universe u27
) ==
u27)
[
SMTPat (FStar.Reflection.V2.Builtins.inspect_universe (FStar.Reflection.V2.Builtins.pack_universe
u27))
] | {
"end_col": 51,
"end_line": 53,
"start_col": 28,
"start_line": 53
} |
FStar.Pervasives.Lemma | val inspect_pack_namedv (t:R.namedv_view)
: Lemma (ensures R.(inspect_namedv (pack_namedv t) == t))
[SMTPat R.(inspect_namedv (pack_namedv t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_namedv = R.inspect_pack_namedv | val inspect_pack_namedv (t:R.namedv_view)
: Lemma (ensures R.(inspect_namedv (pack_namedv t) == t))
[SMTPat R.(inspect_namedv (pack_namedv t))]
let inspect_pack_namedv = | false | null | true | R.inspect_pack_namedv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_namedv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_namedv (t:R.namedv_view)
: Lemma (ensures R.(inspect_namedv (pack_namedv t) == t))
[SMTPat R.(inspect_namedv (pack_namedv t))] | [] | FStar.Reflection.Typing.inspect_pack_namedv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.V2.Data.namedv_view
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.inspect_namedv (FStar.Reflection.V2.Builtins.pack_namedv t) ==
t)
[
SMTPat (FStar.Reflection.V2.Builtins.inspect_namedv (FStar.Reflection.V2.Builtins.pack_namedv
t))
] | {
"end_col": 47,
"end_line": 38,
"start_col": 26,
"start_line": 38
} |
Prims.Tot | val open_with (t:term) (v:term) : term | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 open_with (t:term) (v:term) = RTB.open_with t v | val open_with (t:term) (v:term) : term
let open_with (t v: term) = | false | null | false | RTB.open_with t v | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.Typing.Builtins.open_with"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic () | false | true | FStar.Reflection.Typing.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 open_with (t:term) (v:term) : term | [] | FStar.Reflection.Typing.open_with | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> v: FStar.Reflection.Types.term -> FStar.Reflection.Types.term | {
"end_col": 51,
"end_line": 68,
"start_col": 34,
"start_line": 68
} |
FStar.Pervasives.Lemma | val pack_inspect_bv (t:R.bv)
: Lemma (ensures R.(pack_bv (inspect_bv t) == t))
[SMTPat R.(pack_bv (inspect_bv t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_bv = R.pack_inspect_bv | val pack_inspect_bv (t:R.bv)
: Lemma (ensures R.(pack_bv (inspect_bv t) == t))
[SMTPat R.(pack_bv (inspect_bv t))]
let pack_inspect_bv = | false | null | true | R.pack_inspect_bv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_bv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv | false | false | FStar.Reflection.Typing.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 pack_inspect_bv (t:R.bv)
: Lemma (ensures R.(pack_bv (inspect_bv t) == t))
[SMTPat R.(pack_bv (inspect_bv t))] | [] | FStar.Reflection.Typing.pack_inspect_bv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.bv
-> FStar.Pervasives.Lemma
(ensures FStar.Reflection.V2.Builtins.pack_bv (FStar.Reflection.V2.Builtins.inspect_bv t) == t
) [SMTPat (FStar.Reflection.V2.Builtins.pack_bv (FStar.Reflection.V2.Builtins.inspect_bv t))] | {
"end_col": 39,
"end_line": 42,
"start_col": 22,
"start_line": 42
} |
FStar.Pervasives.Lemma | val inspect_pack_fv (nm:R.name)
: Lemma (ensures R.inspect_fv (R.pack_fv nm) == nm)
[SMTPat (R.inspect_fv (R.pack_fv nm))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_fv = R.inspect_pack_fv | val inspect_pack_fv (nm:R.name)
: Lemma (ensures R.inspect_fv (R.pack_fv nm) == nm)
[SMTPat (R.inspect_fv (R.pack_fv nm))]
let inspect_pack_fv = | false | null | true | R.inspect_pack_fv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_fv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_fv (nm:R.name)
: Lemma (ensures R.inspect_fv (R.pack_fv nm) == nm)
[SMTPat (R.inspect_fv (R.pack_fv nm))] | [] | FStar.Reflection.Typing.inspect_pack_fv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | nm: FStar.Reflection.Types.name
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.inspect_fv (FStar.Reflection.V2.Builtins.pack_fv nm) == nm)
[SMTPat (FStar.Reflection.V2.Builtins.inspect_fv (FStar.Reflection.V2.Builtins.pack_fv nm))] | {
"end_col": 39,
"end_line": 50,
"start_col": 22,
"start_line": 50
} |
FStar.Pervasives.Lemma | val pack_inspect_fv (fv:R.fv)
: Lemma (ensures R.pack_fv (R.inspect_fv fv) == fv)
[SMTPat (R.pack_fv (R.inspect_fv fv))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_fv = R.pack_inspect_fv | val pack_inspect_fv (fv:R.fv)
: Lemma (ensures R.pack_fv (R.inspect_fv fv) == fv)
[SMTPat (R.pack_fv (R.inspect_fv fv))]
let pack_inspect_fv = | false | null | true | R.pack_inspect_fv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_fv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv | false | false | FStar.Reflection.Typing.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 pack_inspect_fv (fv:R.fv)
: Lemma (ensures R.pack_fv (R.inspect_fv fv) == fv)
[SMTPat (R.pack_fv (R.inspect_fv fv))] | [] | FStar.Reflection.Typing.pack_inspect_fv | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | fv: FStar.Reflection.Types.fv
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.pack_fv (FStar.Reflection.V2.Builtins.inspect_fv fv) == fv)
[SMTPat (FStar.Reflection.V2.Builtins.pack_fv (FStar.Reflection.V2.Builtins.inspect_fv fv))] | {
"end_col": 39,
"end_line": 51,
"start_col": 22,
"start_line": 51
} |
FStar.Pervasives.Lemma | val inspect_pack_comp (t:R.comp_view)
: Lemma (ensures (R.inspect_comp (R.pack_comp t) == t))
[SMTPat (R.inspect_comp (R.pack_comp t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 inspect_pack_comp = R.inspect_pack_comp_inv | val inspect_pack_comp (t:R.comp_view)
: Lemma (ensures (R.inspect_comp (R.pack_comp t) == t))
[SMTPat (R.inspect_comp (R.pack_comp t))]
let inspect_pack_comp = | false | null | true | R.inspect_pack_comp_inv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.inspect_pack_comp_inv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder | false | false | FStar.Reflection.Typing.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val inspect_pack_comp (t:R.comp_view)
: Lemma (ensures (R.inspect_comp (R.pack_comp t) == t))
[SMTPat (R.inspect_comp (R.pack_comp t))] | [] | FStar.Reflection.Typing.inspect_pack_comp | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.V2.Data.comp_view
-> FStar.Pervasives.Lemma
(ensures
FStar.Reflection.V2.Builtins.inspect_comp (FStar.Reflection.V2.Builtins.pack_comp t) == t)
[
SMTPat (FStar.Reflection.V2.Builtins.inspect_comp (FStar.Reflection.V2.Builtins.pack_comp t)
)
] | {
"end_col": 47,
"end_line": 47,
"start_col": 24,
"start_line": 47
} |
Prims.Tot | val open_term (t:term) (v:var) : term | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 open_term (t:term) (v:var) = RTB.open_term t v | val open_term (t:term) (v:var) : term
let open_term (t: term) (v: var) = | false | null | false | RTB.open_term t v | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V2.Data.var",
"FStar.Reflection.Typing.Builtins.open_term"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit () | false | true | FStar.Reflection.Typing.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 open_term (t:term) (v:var) : term | [] | FStar.Reflection.Typing.open_term | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> v: FStar.Reflection.V2.Data.var -> FStar.Reflection.Types.term | {
"end_col": 50,
"end_line": 72,
"start_col": 33,
"start_line": 72
} |
Prims.Tot | val rename (t:term) (x y:var) : term | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 rename (t:term) (x y:var)= RTB.rename t x y | val rename (t:term) (x y:var) : term
let rename (t: term) (x y: var) = | false | null | false | RTB.rename t x y | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V2.Data.var",
"FStar.Reflection.Typing.Builtins.rename"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit ()
let open_term (t:term) (v:var) = RTB.open_term t v
let open_term_spec (t:term) (v:var) = admit ()
let close_term (t:term) (v:var) = RTB.close_term t v
let close_term_spec (t:term) (v:var) = admit () | false | true | FStar.Reflection.Typing.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 rename (t:term) (x y:var) : term | [] | FStar.Reflection.Typing.rename | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> x: FStar.Reflection.V2.Data.var -> y: FStar.Reflection.V2.Data.var
-> FStar.Reflection.Types.term | {
"end_col": 47,
"end_line": 80,
"start_col": 31,
"start_line": 80
} |
Prims.Tot | val close_term (t:term) (v:var) : term | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 close_term (t:term) (v:var) = RTB.close_term t v | val close_term (t:term) (v:var) : term
let close_term (t: term) (v: var) = | false | null | false | RTB.close_term t v | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"total"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V2.Data.var",
"FStar.Reflection.Typing.Builtins.close_term"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit ()
let open_term (t:term) (v:var) = RTB.open_term t v
let open_term_spec (t:term) (v:var) = admit () | false | true | FStar.Reflection.Typing.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 close_term (t:term) (v:var) : term | [] | FStar.Reflection.Typing.close_term | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term -> v: FStar.Reflection.V2.Data.var -> FStar.Reflection.Types.term | {
"end_col": 52,
"end_line": 76,
"start_col": 34,
"start_line": 76
} |
FStar.Pervasives.Lemma | val pack_inspect_universe (u:R.universe)
: Lemma (requires ~(Uv_Unk? (inspect_universe u)))
(ensures R.pack_universe (R.inspect_universe u) == u)
[SMTPat (R.pack_universe (R.inspect_universe u))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect_universe = R.pack_inspect_universe | val pack_inspect_universe (u:R.universe)
: Lemma (requires ~(Uv_Unk? (inspect_universe u)))
(ensures R.pack_universe (R.inspect_universe u) == u)
[SMTPat (R.pack_universe (R.inspect_universe u))]
let pack_inspect_universe = | false | null | true | R.pack_inspect_universe | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_universe"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv | false | false | FStar.Reflection.Typing.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 pack_inspect_universe (u:R.universe)
: Lemma (requires ~(Uv_Unk? (inspect_universe u)))
(ensures R.pack_universe (R.inspect_universe u) == u)
[SMTPat (R.pack_universe (R.inspect_universe u))] | [] | FStar.Reflection.Typing.pack_inspect_universe | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | u28: FStar.Reflection.Types.universe
-> FStar.Pervasives.Lemma
(requires ~(Uv_Unk? (FStar.Reflection.V2.Builtins.inspect_universe u28)))
(ensures
FStar.Reflection.V2.Builtins.pack_universe (FStar.Reflection.V2.Builtins.inspect_universe u28
) ==
u28)
[
SMTPat (FStar.Reflection.V2.Builtins.pack_universe (FStar.Reflection.V2.Builtins.inspect_universe
u28))
] | {
"end_col": 51,
"end_line": 54,
"start_col": 28,
"start_line": 54
} |
FStar.Pervasives.Lemma | val pack_inspect (t:R.term)
: Lemma (requires ~(Tv_Unsupp? (inspect_ln t)))
(ensures R.(pack_ln (inspect_ln t) == t))
[SMTPat R.(pack_ln (inspect_ln t))] | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 pack_inspect = R.pack_inspect_inv | val pack_inspect (t:R.term)
: Lemma (requires ~(Tv_Unsupp? (inspect_ln t)))
(ensures R.(pack_ln (inspect_ln t) == t))
[SMTPat R.(pack_ln (inspect_ln t))]
let pack_inspect = | false | null | true | R.pack_inspect_inv | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.V2.Builtins.pack_inspect_inv"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins | false | false | FStar.Reflection.Typing.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 pack_inspect (t:R.term)
: Lemma (requires ~(Tv_Unsupp? (inspect_ln t)))
(ensures R.(pack_ln (inspect_ln t) == t))
[SMTPat R.(pack_ln (inspect_ln t))] | [] | FStar.Reflection.Typing.pack_inspect | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | t: FStar.Reflection.Types.term
-> FStar.Pervasives.Lemma (requires ~(Tv_Unsupp? (FStar.Reflection.V2.Builtins.inspect_ln t)))
(ensures FStar.Reflection.V2.Builtins.pack_ln (FStar.Reflection.V2.Builtins.inspect_ln t) == t
)
[SMTPat (FStar.Reflection.V2.Builtins.pack_ln (FStar.Reflection.V2.Builtins.inspect_ln t))] | {
"end_col": 37,
"end_line": 36,
"start_col": 19,
"start_line": 36
} |
FStar.Pervasives.Lemma | val open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e) | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e)
= close_term_spec e x;
open_term_spec (close_term e x) x;
open_close_inverse' 0 e x | val open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e)
let open_close_inverse (e: R.term{ln e}) (x: var) : Lemma (open_term (close_term e x) x == e) = | false | null | true | close_term_spec e x;
open_term_spec (close_term e x) x;
open_close_inverse' 0 e x | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.Types.term",
"Prims.b2t",
"FStar.Reflection.Typing.ln",
"FStar.Reflection.V2.Data.var",
"FStar.Reflection.Typing.open_close_inverse'",
"Prims.unit",
"FStar.Reflection.Typing.open_term_spec",
"FStar.Reflection.Typing.close_term",
"FStar.Reflection.Typing.close_term_spec",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.Reflection.Typing.open_term",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit ()
let open_term (t:term) (v:var) = RTB.open_term t v
let open_term_spec (t:term) (v:var) = admit ()
let close_term (t:term) (v:var) = RTB.close_term t v
let close_term_spec (t:term) (v:var) = admit ()
let rename (t:term) (x y:var)= RTB.rename t x y
let rename_spec (t:term) (x y:var) = admit ()
let bv_index_of_make_bv (n:nat) = ()
let namedv_uniq_of_make_namedv (n:nat) = ()
let bindings_ok_for_pat bnds pat = magic ()
let bindings_ok_pat_constant c = admit ()
let subtyping_token_renaming (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(y:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) y) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@(x,t)::bs0)) t0 t1) = magic ()
let subtyping_token_weakening (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@bs0)) t0 t1) = magic ()
let well_typed_terms_are_ln _ _ _ _ = admit ()
let type_correctness _ _ _ _ = admit ()
let rec binder_offset_pattern_invariant (p:pattern) (ss:subst)
: Lemma (ensures binder_offset_pattern p ==
binder_offset_pattern (subst_pattern p ss))
(decreases p)
= match p with
| Pat_Cons _ _ pats ->
binder_offset_patterns_invariant pats ss
| _ -> ()
and binder_offset_patterns_invariant (p:list (pattern & bool)) (ss:subst)
: Lemma (ensures binder_offset_patterns p ==
binder_offset_patterns (subst_patterns p ss))
(decreases p)
= match p with
| [] -> ()
| (hd, _)::tl ->
binder_offset_pattern_invariant hd ss;
let n = binder_offset_pattern hd in
binder_offset_patterns_invariant tl (shift_subst_n n ss)
let rec open_close_inverse' (i:nat) (t:term { ln' t (i - 1) }) (x:var)
: Lemma
(ensures subst_term
(subst_term t [ ND x i ])
(open_with_var x i)
== t)
(decreases t)
= match inspect_ln t with
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown
| Tv_BVar _ -> ()
| Tv_Var _ -> ()
| Tv_App t1 a ->
open_close_inverse' i t1 x;
open_close_inverse' i (fst a) x
| Tv_Abs b body ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) body x
| Tv_Arrow b c ->
open_close_inverse'_binder i b x;
open_close_inverse'_comp (i + 1) c x
| Tv_Refine b f ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) f x
| Tv_Let recf attrs b def body ->
open_close_inverse'_terms i attrs x;
open_close_inverse'_binder i b x;
(if recf
then open_close_inverse' (i + 1) def x
else open_close_inverse' i def x);
open_close_inverse' (i + 1) body x
| Tv_Match scr ret brs ->
open_close_inverse' i scr x;
(match ret with
| None -> ()
| Some m -> open_close_inverse'_match_returns i m x);
open_close_inverse'_branches i brs x
| Tv_AscribedT e t tac b ->
open_close_inverse' i e x;
open_close_inverse' i t x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
| Tv_AscribedC e c tac b ->
open_close_inverse' i e x;
open_close_inverse'_comp i c x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
and open_close_inverse'_binder (i:nat) (b:binder { ln'_binder b (i - 1) }) (x:var)
: Lemma (ensures subst_binder
(subst_binder b [ ND x i ])
(open_with_var x i)
== b)
(decreases b)
= let bndr = inspect_binder b in
let {ppname; qual=q; attrs=attrs; sort=sort} = bndr in
open_close_inverse' i sort x;
open_close_inverse'_terms i attrs x;
assert (subst_terms (subst_terms attrs [ ND x i ])
(open_with_var x i) == attrs);
pack_inspect_binder b;
assert (pack_binder {ppname; qual=q; attrs=attrs; sort=sort} == b)
and open_close_inverse'_terms (i:nat) (ts:list term { ln'_terms ts (i - 1) }) (x:var)
: Lemma (ensures subst_terms
(subst_terms ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| t::ts ->
open_close_inverse' i t x;
open_close_inverse'_terms i ts x
and open_close_inverse'_comp (i:nat) (c:comp { ln'_comp c (i - 1) }) (x:var)
: Lemma
(ensures subst_comp
(subst_comp c [ ND x i ])
(open_with_var x i)
== c)
(decreases c)
= match inspect_comp c with
| C_Total t
| C_GTotal t -> open_close_inverse' i t x
| C_Lemma pre post pats ->
open_close_inverse' i pre x;
open_close_inverse' i post x;
open_close_inverse' i pats x
| C_Eff us eff_name res args decrs ->
open_close_inverse' i res x;
open_close_inverse'_args i args x;
open_close_inverse'_terms i decrs x
and open_close_inverse'_args (i:nat)
(ts:list argv { ln'_args ts (i - 1) })
(x:var)
: Lemma
(ensures subst_args
(subst_args ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| (t,q)::ts ->
open_close_inverse' i t x;
open_close_inverse'_args i ts x
and open_close_inverse'_patterns (i:nat)
(ps:list (pattern & bool) { ln'_patterns ps (i - 1) })
(x:var)
: Lemma
(ensures subst_patterns
(subst_patterns ps [ ND x i ])
(open_with_var x i)
== ps)
(decreases ps)
= match ps with
| [] -> ()
| (p, b)::ps' ->
open_close_inverse'_pattern i p x;
let n = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_patterns (i + n) ps' x
and open_close_inverse'_pattern (i:nat) (p:pattern{ln'_pattern p (i - 1)}) (x:var)
: Lemma
(ensures subst_pattern
(subst_pattern p [ ND x i ])
(open_with_var x i)
== p)
(decreases p)
= match p with
| Pat_Constant _ -> ()
| Pat_Cons fv us pats ->
open_close_inverse'_patterns i pats x
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
match topt with
| None -> ()
| Some t -> open_close_inverse' i t x
and open_close_inverse'_branch (i:nat) (br:branch{ln'_branch br (i - 1)}) (x:var)
: Lemma
(ensures subst_branch
(subst_branch br [ ND x i ])
(open_with_var x i)
== br)
(decreases br)
= let p, t = br in
let j = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_pattern i p x;
open_close_inverse' (i + j) t x
and open_close_inverse'_branches (i:nat)
(brs:list branch { ln'_branches brs (i - 1) })
(x:var)
: Lemma
(ensures subst_branches
(subst_branches brs [ ND x i ])
(open_with_var x i)
== brs)
(decreases brs)
= match brs with
| [] -> ()
| br::brs ->
open_close_inverse'_branch i br x;
open_close_inverse'_branches i brs x
and open_close_inverse'_match_returns (i:nat)
(m:match_returns_ascription { ln'_match_returns m (i - 1) })
(x:var)
: Lemma
(ensures subst_match_returns
(subst_match_returns m [ ND x i ])
(open_with_var x i)
== m)
(decreases m)
= let b, (ret, as_, eq) = m in
open_close_inverse'_binder i b x;
let ret =
match ret with
| Inl t ->
open_close_inverse' (i + 1) t x
| Inr c ->
open_close_inverse'_comp (i + 1) c x
in
let as_ =
match as_ with
| None -> ()
| Some t ->
open_close_inverse' (i + 1) t x
in
()
let open_close_inverse (e:R.term { ln e }) (x:var) | false | false | FStar.Reflection.Typing.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 open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e) | [] | FStar.Reflection.Typing.open_close_inverse | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | e: FStar.Reflection.Types.term{FStar.Reflection.Typing.ln e} -> x: FStar.Reflection.V2.Data.var
-> FStar.Pervasives.Lemma
(ensures FStar.Reflection.Typing.open_term (FStar.Reflection.Typing.close_term e x) x == e) | {
"end_col": 30,
"end_line": 352,
"start_col": 5,
"start_line": 350
} |
FStar.Pervasives.Lemma | val close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) })
: Lemma (close_term (open_term e x) x == e) | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) })
: Lemma (close_term (open_term e x) x == e)
= open_term_spec e x;
close_term_spec (open_term e x) x;
close_open_inverse' 0 e x | val close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) })
: Lemma (close_term (open_term e x) x == e)
let close_open_inverse (e: R.term) (x: var{~(x `Set.mem` (freevars e))})
: Lemma (close_term (open_term e x) x == e) = | false | null | true | open_term_spec e x;
close_term_spec (open_term e x) x;
close_open_inverse' 0 e x | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"lemma"
] | [
"FStar.Reflection.Types.term",
"FStar.Reflection.V2.Data.var",
"Prims.l_not",
"Prims.b2t",
"FStar.Set.mem",
"FStar.Reflection.Typing.freevars",
"FStar.Reflection.Typing.close_open_inverse'",
"Prims.unit",
"FStar.Reflection.Typing.close_term_spec",
"FStar.Reflection.Typing.open_term",
"FStar.Reflection.Typing.open_term_spec",
"Prims.l_True",
"Prims.squash",
"Prims.eq2",
"FStar.Reflection.Typing.close_term",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit ()
let open_term (t:term) (v:var) = RTB.open_term t v
let open_term_spec (t:term) (v:var) = admit ()
let close_term (t:term) (v:var) = RTB.close_term t v
let close_term_spec (t:term) (v:var) = admit ()
let rename (t:term) (x y:var)= RTB.rename t x y
let rename_spec (t:term) (x y:var) = admit ()
let bv_index_of_make_bv (n:nat) = ()
let namedv_uniq_of_make_namedv (n:nat) = ()
let bindings_ok_for_pat bnds pat = magic ()
let bindings_ok_pat_constant c = admit ()
let subtyping_token_renaming (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(y:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) y) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@(x,t)::bs0)) t0 t1) = magic ()
let subtyping_token_weakening (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@bs0)) t0 t1) = magic ()
let well_typed_terms_are_ln _ _ _ _ = admit ()
let type_correctness _ _ _ _ = admit ()
let rec binder_offset_pattern_invariant (p:pattern) (ss:subst)
: Lemma (ensures binder_offset_pattern p ==
binder_offset_pattern (subst_pattern p ss))
(decreases p)
= match p with
| Pat_Cons _ _ pats ->
binder_offset_patterns_invariant pats ss
| _ -> ()
and binder_offset_patterns_invariant (p:list (pattern & bool)) (ss:subst)
: Lemma (ensures binder_offset_patterns p ==
binder_offset_patterns (subst_patterns p ss))
(decreases p)
= match p with
| [] -> ()
| (hd, _)::tl ->
binder_offset_pattern_invariant hd ss;
let n = binder_offset_pattern hd in
binder_offset_patterns_invariant tl (shift_subst_n n ss)
let rec open_close_inverse' (i:nat) (t:term { ln' t (i - 1) }) (x:var)
: Lemma
(ensures subst_term
(subst_term t [ ND x i ])
(open_with_var x i)
== t)
(decreases t)
= match inspect_ln t with
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown
| Tv_BVar _ -> ()
| Tv_Var _ -> ()
| Tv_App t1 a ->
open_close_inverse' i t1 x;
open_close_inverse' i (fst a) x
| Tv_Abs b body ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) body x
| Tv_Arrow b c ->
open_close_inverse'_binder i b x;
open_close_inverse'_comp (i + 1) c x
| Tv_Refine b f ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) f x
| Tv_Let recf attrs b def body ->
open_close_inverse'_terms i attrs x;
open_close_inverse'_binder i b x;
(if recf
then open_close_inverse' (i + 1) def x
else open_close_inverse' i def x);
open_close_inverse' (i + 1) body x
| Tv_Match scr ret brs ->
open_close_inverse' i scr x;
(match ret with
| None -> ()
| Some m -> open_close_inverse'_match_returns i m x);
open_close_inverse'_branches i brs x
| Tv_AscribedT e t tac b ->
open_close_inverse' i e x;
open_close_inverse' i t x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
| Tv_AscribedC e c tac b ->
open_close_inverse' i e x;
open_close_inverse'_comp i c x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
and open_close_inverse'_binder (i:nat) (b:binder { ln'_binder b (i - 1) }) (x:var)
: Lemma (ensures subst_binder
(subst_binder b [ ND x i ])
(open_with_var x i)
== b)
(decreases b)
= let bndr = inspect_binder b in
let {ppname; qual=q; attrs=attrs; sort=sort} = bndr in
open_close_inverse' i sort x;
open_close_inverse'_terms i attrs x;
assert (subst_terms (subst_terms attrs [ ND x i ])
(open_with_var x i) == attrs);
pack_inspect_binder b;
assert (pack_binder {ppname; qual=q; attrs=attrs; sort=sort} == b)
and open_close_inverse'_terms (i:nat) (ts:list term { ln'_terms ts (i - 1) }) (x:var)
: Lemma (ensures subst_terms
(subst_terms ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| t::ts ->
open_close_inverse' i t x;
open_close_inverse'_terms i ts x
and open_close_inverse'_comp (i:nat) (c:comp { ln'_comp c (i - 1) }) (x:var)
: Lemma
(ensures subst_comp
(subst_comp c [ ND x i ])
(open_with_var x i)
== c)
(decreases c)
= match inspect_comp c with
| C_Total t
| C_GTotal t -> open_close_inverse' i t x
| C_Lemma pre post pats ->
open_close_inverse' i pre x;
open_close_inverse' i post x;
open_close_inverse' i pats x
| C_Eff us eff_name res args decrs ->
open_close_inverse' i res x;
open_close_inverse'_args i args x;
open_close_inverse'_terms i decrs x
and open_close_inverse'_args (i:nat)
(ts:list argv { ln'_args ts (i - 1) })
(x:var)
: Lemma
(ensures subst_args
(subst_args ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| (t,q)::ts ->
open_close_inverse' i t x;
open_close_inverse'_args i ts x
and open_close_inverse'_patterns (i:nat)
(ps:list (pattern & bool) { ln'_patterns ps (i - 1) })
(x:var)
: Lemma
(ensures subst_patterns
(subst_patterns ps [ ND x i ])
(open_with_var x i)
== ps)
(decreases ps)
= match ps with
| [] -> ()
| (p, b)::ps' ->
open_close_inverse'_pattern i p x;
let n = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_patterns (i + n) ps' x
and open_close_inverse'_pattern (i:nat) (p:pattern{ln'_pattern p (i - 1)}) (x:var)
: Lemma
(ensures subst_pattern
(subst_pattern p [ ND x i ])
(open_with_var x i)
== p)
(decreases p)
= match p with
| Pat_Constant _ -> ()
| Pat_Cons fv us pats ->
open_close_inverse'_patterns i pats x
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
match topt with
| None -> ()
| Some t -> open_close_inverse' i t x
and open_close_inverse'_branch (i:nat) (br:branch{ln'_branch br (i - 1)}) (x:var)
: Lemma
(ensures subst_branch
(subst_branch br [ ND x i ])
(open_with_var x i)
== br)
(decreases br)
= let p, t = br in
let j = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_pattern i p x;
open_close_inverse' (i + j) t x
and open_close_inverse'_branches (i:nat)
(brs:list branch { ln'_branches brs (i - 1) })
(x:var)
: Lemma
(ensures subst_branches
(subst_branches brs [ ND x i ])
(open_with_var x i)
== brs)
(decreases brs)
= match brs with
| [] -> ()
| br::brs ->
open_close_inverse'_branch i br x;
open_close_inverse'_branches i brs x
and open_close_inverse'_match_returns (i:nat)
(m:match_returns_ascription { ln'_match_returns m (i - 1) })
(x:var)
: Lemma
(ensures subst_match_returns
(subst_match_returns m [ ND x i ])
(open_with_var x i)
== m)
(decreases m)
= let b, (ret, as_, eq) = m in
open_close_inverse'_binder i b x;
let ret =
match ret with
| Inl t ->
open_close_inverse' (i + 1) t x
| Inr c ->
open_close_inverse'_comp (i + 1) c x
in
let as_ =
match as_ with
| None -> ()
| Some t ->
open_close_inverse' (i + 1) t x
in
()
let open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e)
= close_term_spec e x;
open_term_spec (close_term e x) x;
open_close_inverse' 0 e x
let rec close_open_inverse' (i:nat)
(t:term)
(x:var { ~(x `Set.mem` freevars t) })
: Lemma
(ensures subst_term
(subst_term t (open_with_var x i))
[ ND x i ]
== t)
(decreases t)
= match inspect_ln t with
| Tv_Uvar _ _ -> assert false
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown -> ()
| Tv_BVar _ -> ()
| Tv_Var _ -> ()
| Tv_App t1 a ->
close_open_inverse' i t1 x;
close_open_inverse' i (fst a) x
| Tv_Abs b body ->
close_open_inverse'_binder i b x;
close_open_inverse' (i + 1) body x
| Tv_Arrow b c ->
close_open_inverse'_binder i b x;
close_open_inverse'_comp (i + 1) c x
| Tv_Refine b f ->
close_open_inverse'_binder i b x;
close_open_inverse' (i + 1) f x
| Tv_Let recf attrs b def body ->
close_open_inverse'_terms i attrs x;
close_open_inverse'_binder i b x;
close_open_inverse' (if recf then (i + 1) else i) def x;
close_open_inverse' (i + 1) body x
| Tv_Match scr ret brs ->
close_open_inverse' i scr x;
(match ret with
| None -> ()
| Some m -> close_open_inverse'_match_returns i m x);
close_open_inverse'_branches i brs x
| Tv_AscribedT e t tac b ->
close_open_inverse' i e x;
close_open_inverse' i t x;
(match tac with
| None -> ()
| Some t -> close_open_inverse' i t x)
| Tv_AscribedC e c tac b ->
close_open_inverse' i e x;
close_open_inverse'_comp i c x;
(match tac with
| None -> ()
| Some t -> close_open_inverse' i t x)
and close_open_inverse'_comp (i:nat)
(c:comp)
(x:var{ ~(x `Set.mem` freevars_comp c) })
: Lemma
(ensures subst_comp
(subst_comp c (open_with_var x i))
[ ND x i ]
== c)
(decreases c)
= match inspect_comp c with
| C_Total t
| C_GTotal t ->
close_open_inverse' i t x
| C_Lemma pre post pats ->
close_open_inverse' i pre x;
close_open_inverse' i post x;
close_open_inverse' i pats x
| C_Eff us eff_name res args decrs ->
close_open_inverse' i res x;
close_open_inverse'_args i args x;
close_open_inverse'_terms i decrs x
and close_open_inverse'_args (i:nat) (args:list argv) (x:var{ ~(x `Set.mem` freevars_args args) })
: Lemma
(ensures subst_args
(subst_args args (open_with_var x i))
[ ND x i]
== args)
(decreases args)
= match args with
| [] -> ()
| (a, q) :: args ->
close_open_inverse' i a x;
close_open_inverse'_args i args x
and close_open_inverse'_binder (i:nat) (b:binder) (x:var{ ~(x `Set.mem` freevars_binder b) })
: Lemma
(ensures subst_binder
(subst_binder b (open_with_var x i))
[ ND x i ]
== b)
(decreases b)
= let bndr = inspect_binder b in
close_open_inverse' i bndr.sort x;
close_open_inverse'_terms i bndr.attrs x;
pack_inspect_binder b
and close_open_inverse'_terms (i:nat) (ts:list term) (x:var{ ~(x `Set.mem` freevars_terms ts) })
: Lemma
(ensures subst_terms
(subst_terms ts (open_with_var x i))
[ ND x i ]
== ts)
(decreases ts)
= match ts with
| [] -> ()
| hd :: tl ->
close_open_inverse' i hd x;
close_open_inverse'_terms i tl x
and close_open_inverse'_branches (i:nat) (brs:list branch)
(x:var{ ~(x `Set.mem` freevars_branches brs) })
: Lemma
(ensures subst_branches
(subst_branches brs (open_with_var x i))
[ ND x i ]
== brs)
(decreases brs)
= match brs with
| [] -> ()
| b :: brs ->
close_open_inverse'_branch i b x;
close_open_inverse'_branches i brs x
and close_open_inverse'_branch (i:nat)
(br:branch)
(x:var{ ~(x `Set.mem` freevars_branch br) })
: Lemma
(ensures subst_branch
(subst_branch br (open_with_var x i))
[ ND x i ]
== br)
(decreases br)
= let p, t = br in
close_open_inverse'_pattern i p x;
binder_offset_pattern_invariant p (open_with_var x i);
close_open_inverse' (i + binder_offset_pattern p) t x
and close_open_inverse'_pattern (i:nat)
(p:pattern)
(x:var{ ~(x `Set.mem` freevars_pattern p) })
: Lemma
(ensures subst_pattern
(subst_pattern p (open_with_var x i))
[ ND x i ]
== p)
(decreases p)
= match p with
| Pat_Constant _ -> ()
| Pat_Cons fv us pats ->
close_open_inverse'_patterns i pats x
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
match topt with
| None -> ()
| Some t -> close_open_inverse' i t x
and close_open_inverse'_patterns (i:nat)
(ps:list (pattern & bool))
(x:var {~ (x `Set.mem` freevars_patterns ps) })
: Lemma
(ensures subst_patterns
(subst_patterns ps (open_with_var x i))
[ ND x i ]
== ps)
(decreases ps)
= match ps with
| [] -> ()
| (p, b)::ps' ->
close_open_inverse'_pattern i p x;
let n = binder_offset_pattern p in
binder_offset_pattern_invariant p (open_with_var x i);
close_open_inverse'_patterns (i + n) ps' x
and close_open_inverse'_match_returns (i:nat) (m:match_returns_ascription)
(x:var{ ~(x `Set.mem` freevars_match_returns m) })
: Lemma
(ensures subst_match_returns
(subst_match_returns m (open_with_var x i))
[ ND x i ]
== m)
(decreases m)
= let b, (ret, as_, eq) = m in
close_open_inverse'_binder i b x;
(match ret with
| Inl t -> close_open_inverse' (i + 1) t x
| Inr c -> close_open_inverse'_comp (i + 1) c x);
(match as_ with
| None -> ()
| Some t -> close_open_inverse' (i + 1) t x)
let close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) }) | false | false | FStar.Reflection.Typing.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 close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) })
: Lemma (close_term (open_term e x) x == e) | [] | FStar.Reflection.Typing.close_open_inverse | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} |
e: FStar.Reflection.Types.term ->
x: FStar.Reflection.V2.Data.var{~(FStar.Set.mem x (FStar.Reflection.Typing.freevars e))}
-> FStar.Pervasives.Lemma
(ensures FStar.Reflection.Typing.close_term (FStar.Reflection.Typing.open_term e x) x == e) | {
"end_col": 30,
"end_line": 568,
"start_col": 5,
"start_line": 566
} |
Prims.Tot | val mkif
(g:fstar_env)
(scrutinee:term)
(then_:term)
(else_:term)
(ty:term)
(u_ty:universe)
(hyp:var { None? (lookup_bvar g hyp) /\ ~(hyp `Set.mem` (freevars then_ `Set.union` freevars else_)) })
(eff:T.tot_or_ghost)
(ty_eff:T.tot_or_ghost)
(ts : typing g scrutinee (eff, bool_ty))
(tt : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool)) then_ (eff, ty))
(te : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool)) else_ (eff, ty))
(tr : typing g ty (ty_eff, tm_type u_ty))
: typing g (mk_if scrutinee then_ else_) (eff, ty) | [
{
"abbrev": true,
"full_module": "FStar.Reflection.Typing.Builtins",
"short_module": "RTB"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2.Data",
"short_module": "RD"
},
{
"abbrev": true,
"full_module": "FStar.Tactics.V2",
"short_module": "T"
},
{
"abbrev": true,
"full_module": "FStar.Reflection.V2",
"short_module": "R"
},
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": false,
"full_module": "FStar.Reflection.V2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.List.Tot",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Reflection",
"short_module": null
},
{
"abbrev": 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 mkif
(g:fstar_env)
(scrutinee:term)
(then_:term)
(else_:term)
(ty:term)
(u_ty:universe)
(hyp:var { None? (lookup_bvar g hyp) /\ ~(hyp `Set.mem` (freevars then_ `Set.union` freevars else_)) })
(eff:T.tot_or_ghost)
(ty_eff:T.tot_or_ghost)
(ts : typing g scrutinee (eff, bool_ty))
(tt : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool)) then_ (eff, ty))
(te : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool)) else_ (eff, ty))
(tr : typing g ty (ty_eff, tm_type u_ty))
: typing g (mk_if scrutinee then_ else_) (eff, ty)
= let brt = (Pat_Constant C_True, then_) in
let bre = (Pat_Constant C_False, else_) in
bindings_ok_pat_constant g C_True;
bindings_ok_pat_constant g C_False;
let brty () : branches_typing g u_zero bool_ty scrutinee (eff,ty) [brt; bre] [[]; []] =
BT_S (Pat_Constant C_True, then_) []
(BO (Pat_Constant C_True) [] hyp then_ () tt)
_ _ (
BT_S (Pat_Constant C_False, else_) []
(BO (Pat_Constant C_False) [] hyp else_ () te)
_ _
BT_Nil)
in
T_Match g u_zero bool_ty scrutinee T.E_Total (T_FVar g bool_fv) eff ts [brt; bre] (eff, ty)
[[]; []]
(MC_Tok g scrutinee bool_ty _ _ (Squash.return_squash (if_complete_match g scrutinee)))
(brty ()) | val mkif
(g:fstar_env)
(scrutinee:term)
(then_:term)
(else_:term)
(ty:term)
(u_ty:universe)
(hyp:var { None? (lookup_bvar g hyp) /\ ~(hyp `Set.mem` (freevars then_ `Set.union` freevars else_)) })
(eff:T.tot_or_ghost)
(ty_eff:T.tot_or_ghost)
(ts : typing g scrutinee (eff, bool_ty))
(tt : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool)) then_ (eff, ty))
(te : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool)) else_ (eff, ty))
(tr : typing g ty (ty_eff, tm_type u_ty))
: typing g (mk_if scrutinee then_ else_) (eff, ty)
let mkif
(g: fstar_env)
(scrutinee then_ else_ ty: term)
(u_ty: universe)
(hyp:
var
{ None? (lookup_bvar g hyp) /\
~(hyp `Set.mem` ((freevars then_) `Set.union` (freevars else_))) })
(eff ty_eff: T.tot_or_ghost)
(ts: typing g scrutinee (eff, bool_ty))
(tt:
typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool))
then_
(eff, ty))
(te:
typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool))
else_
(eff, ty))
(tr: typing g ty (ty_eff, tm_type u_ty))
: typing g (mk_if scrutinee then_ else_) (eff, ty) = | false | null | false | let brt = (Pat_Constant C_True, then_) in
let bre = (Pat_Constant C_False, else_) in
bindings_ok_pat_constant g C_True;
bindings_ok_pat_constant g C_False;
let brty () : branches_typing g u_zero bool_ty scrutinee (eff, ty) [brt; bre] [[]; []] =
BT_S (Pat_Constant C_True, then_)
[]
(BO (Pat_Constant C_True) [] hyp then_ () tt)
_
_
(BT_S (Pat_Constant C_False, else_) [] (BO (Pat_Constant C_False) [] hyp else_ () te) _ _ BT_Nil
)
in
T_Match g
u_zero
bool_ty
scrutinee
T.E_Total
(T_FVar g bool_fv)
eff
ts
[brt; bre]
(eff, ty)
[[]; []]
(MC_Tok g scrutinee bool_ty _ _ (Squash.return_squash (if_complete_match g scrutinee)))
(brty ()) | {
"checked_file": "FStar.Reflection.Typing.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.V2.fst.checked",
"FStar.Squash.fsti.checked",
"FStar.Set.fsti.checked",
"FStar.Reflection.V2.fst.checked",
"FStar.Reflection.Typing.Builtins.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": true,
"source_file": "FStar.Reflection.Typing.fst"
} | [
"total"
] | [
"FStar.Reflection.Typing.fstar_env",
"FStar.Reflection.Types.term",
"FStar.Reflection.Types.universe",
"FStar.Reflection.V2.Data.var",
"Prims.l_and",
"Prims.b2t",
"FStar.Pervasives.Native.uu___is_None",
"FStar.Reflection.Typing.lookup_bvar",
"Prims.l_not",
"FStar.Set.mem",
"FStar.Set.union",
"FStar.Reflection.Typing.freevars",
"FStar.Stubs.TypeChecker.Core.tot_or_ghost",
"FStar.Reflection.Typing.typing",
"FStar.Pervasives.Native.Mktuple2",
"FStar.Reflection.Types.typ",
"FStar.Reflection.Typing.bool_ty",
"FStar.Reflection.Typing.extend_env",
"FStar.Reflection.Typing.eq2",
"FStar.Reflection.V2.Builtins.pack_universe",
"FStar.Reflection.V2.Data.Uv_Zero",
"FStar.Reflection.Typing.true_bool",
"FStar.Reflection.Typing.false_bool",
"FStar.Reflection.Typing.tm_type",
"FStar.Reflection.Typing.T_Match",
"FStar.Reflection.Typing.u_zero",
"FStar.Stubs.TypeChecker.Core.E_Total",
"FStar.Reflection.Typing.T_FVar",
"FStar.Reflection.Typing.bool_fv",
"Prims.Cons",
"FStar.Reflection.V2.Data.branch",
"Prims.Nil",
"Prims.list",
"FStar.Reflection.V2.Data.binding",
"FStar.Reflection.Typing.MC_Tok",
"FStar.List.Tot.Base.map",
"FStar.Reflection.V2.Data.pattern",
"FStar.Pervasives.Native.fst",
"FStar.Squash.return_squash",
"FStar.Tactics.V2.Builtins.match_complete_token",
"FStar.Reflection.Typing.if_complete_match",
"Prims.unit",
"FStar.Reflection.Typing.branches_typing",
"FStar.Reflection.Typing.BT_S",
"FStar.Reflection.V2.Data.Pat_Constant",
"FStar.Reflection.V2.Data.C_True",
"FStar.Reflection.Typing.BO",
"FStar.Reflection.V2.Data.C_False",
"FStar.Reflection.Typing.BT_Nil",
"FStar.Reflection.Typing.bindings_ok_pat_constant",
"FStar.Pervasives.Native.tuple2",
"FStar.Reflection.Typing.mk_if"
] | [] | (*
Copyright 2008-2023 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Reflection.Typing
(** This module defines a typing judgment for (parts of) the total
fragment of F*. We are using it in the meta DSL framework as an
official specification for the F* type system.
We expect it to grow to cover more of the F* language.
IT IS HIGHLY EXPERIMENTAL AND NOT YET READY TO USE.
*)
open FStar.List.Tot
open FStar.Reflection.V2
module R = FStar.Reflection.V2
module T = FStar.Tactics.V2
module RTB = FStar.Reflection.Typing.Builtins
let inspect_pack = R.inspect_pack_inv
let pack_inspect = R.pack_inspect_inv
let inspect_pack_namedv = R.inspect_pack_namedv
let pack_inspect_namedv = R.pack_inspect_namedv
let inspect_pack_bv = R.inspect_pack_bv
let pack_inspect_bv = R.pack_inspect_bv
let inspect_pack_binder = R.inspect_pack_binder
let pack_inspect_binder = R.pack_inspect_binder
let inspect_pack_comp = R.inspect_pack_comp_inv
let pack_inspect_comp = R.pack_inspect_comp_inv
let inspect_pack_fv = R.inspect_pack_fv
let pack_inspect_fv = R.pack_inspect_fv
let inspect_pack_universe = R.inspect_pack_universe
let pack_inspect_universe = R.pack_inspect_universe
let lookup_bvar (e:env) (x:int) : option term = magic ()
let lookup_fvar_uinst (e:R.env) (x:R.fv) (us:list R.universe)
: option R.term = magic ()
let lookup_bvar_extend_env (g:env) (x y:var) (ty:term) = admit ()
let lookup_fvar_extend_env (g:env) (x:fv) (us:universes) (y:var) (ty:term) = admit ()
let subst_ctx_uvar_and_subst _ _ = magic ()
let open_with (t:term) (v:term) = RTB.open_with t v
let open_with_spec (t v:term) = admit ()
let open_term (t:term) (v:var) = RTB.open_term t v
let open_term_spec (t:term) (v:var) = admit ()
let close_term (t:term) (v:var) = RTB.close_term t v
let close_term_spec (t:term) (v:var) = admit ()
let rename (t:term) (x y:var)= RTB.rename t x y
let rename_spec (t:term) (x y:var) = admit ()
let bv_index_of_make_bv (n:nat) = ()
let namedv_uniq_of_make_namedv (n:nat) = ()
let bindings_ok_for_pat bnds pat = magic ()
let bindings_ok_pat_constant c = admit ()
let subtyping_token_renaming (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(y:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) y) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@(x,t)::bs0)) t0 t1) = magic ()
let subtyping_token_weakening (g:env)
(bs0:bindings)
(bs1:bindings)
(x:var { None? (lookup_bvar (extend_env_l g (bs1@bs0)) x) })
(t:term)
(t0 t1:term)
(d:T.subtyping_token (extend_env_l g (bs1@bs0)) t0 t1) = magic ()
let well_typed_terms_are_ln _ _ _ _ = admit ()
let type_correctness _ _ _ _ = admit ()
let rec binder_offset_pattern_invariant (p:pattern) (ss:subst)
: Lemma (ensures binder_offset_pattern p ==
binder_offset_pattern (subst_pattern p ss))
(decreases p)
= match p with
| Pat_Cons _ _ pats ->
binder_offset_patterns_invariant pats ss
| _ -> ()
and binder_offset_patterns_invariant (p:list (pattern & bool)) (ss:subst)
: Lemma (ensures binder_offset_patterns p ==
binder_offset_patterns (subst_patterns p ss))
(decreases p)
= match p with
| [] -> ()
| (hd, _)::tl ->
binder_offset_pattern_invariant hd ss;
let n = binder_offset_pattern hd in
binder_offset_patterns_invariant tl (shift_subst_n n ss)
let rec open_close_inverse' (i:nat) (t:term { ln' t (i - 1) }) (x:var)
: Lemma
(ensures subst_term
(subst_term t [ ND x i ])
(open_with_var x i)
== t)
(decreases t)
= match inspect_ln t with
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown
| Tv_BVar _ -> ()
| Tv_Var _ -> ()
| Tv_App t1 a ->
open_close_inverse' i t1 x;
open_close_inverse' i (fst a) x
| Tv_Abs b body ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) body x
| Tv_Arrow b c ->
open_close_inverse'_binder i b x;
open_close_inverse'_comp (i + 1) c x
| Tv_Refine b f ->
open_close_inverse'_binder i b x;
open_close_inverse' (i + 1) f x
| Tv_Let recf attrs b def body ->
open_close_inverse'_terms i attrs x;
open_close_inverse'_binder i b x;
(if recf
then open_close_inverse' (i + 1) def x
else open_close_inverse' i def x);
open_close_inverse' (i + 1) body x
| Tv_Match scr ret brs ->
open_close_inverse' i scr x;
(match ret with
| None -> ()
| Some m -> open_close_inverse'_match_returns i m x);
open_close_inverse'_branches i brs x
| Tv_AscribedT e t tac b ->
open_close_inverse' i e x;
open_close_inverse' i t x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
| Tv_AscribedC e c tac b ->
open_close_inverse' i e x;
open_close_inverse'_comp i c x;
(match tac with
| None -> ()
| Some tac -> open_close_inverse' i tac x)
and open_close_inverse'_binder (i:nat) (b:binder { ln'_binder b (i - 1) }) (x:var)
: Lemma (ensures subst_binder
(subst_binder b [ ND x i ])
(open_with_var x i)
== b)
(decreases b)
= let bndr = inspect_binder b in
let {ppname; qual=q; attrs=attrs; sort=sort} = bndr in
open_close_inverse' i sort x;
open_close_inverse'_terms i attrs x;
assert (subst_terms (subst_terms attrs [ ND x i ])
(open_with_var x i) == attrs);
pack_inspect_binder b;
assert (pack_binder {ppname; qual=q; attrs=attrs; sort=sort} == b)
and open_close_inverse'_terms (i:nat) (ts:list term { ln'_terms ts (i - 1) }) (x:var)
: Lemma (ensures subst_terms
(subst_terms ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| t::ts ->
open_close_inverse' i t x;
open_close_inverse'_terms i ts x
and open_close_inverse'_comp (i:nat) (c:comp { ln'_comp c (i - 1) }) (x:var)
: Lemma
(ensures subst_comp
(subst_comp c [ ND x i ])
(open_with_var x i)
== c)
(decreases c)
= match inspect_comp c with
| C_Total t
| C_GTotal t -> open_close_inverse' i t x
| C_Lemma pre post pats ->
open_close_inverse' i pre x;
open_close_inverse' i post x;
open_close_inverse' i pats x
| C_Eff us eff_name res args decrs ->
open_close_inverse' i res x;
open_close_inverse'_args i args x;
open_close_inverse'_terms i decrs x
and open_close_inverse'_args (i:nat)
(ts:list argv { ln'_args ts (i - 1) })
(x:var)
: Lemma
(ensures subst_args
(subst_args ts [ ND x i ])
(open_with_var x i)
== ts)
(decreases ts)
= match ts with
| [] -> ()
| (t,q)::ts ->
open_close_inverse' i t x;
open_close_inverse'_args i ts x
and open_close_inverse'_patterns (i:nat)
(ps:list (pattern & bool) { ln'_patterns ps (i - 1) })
(x:var)
: Lemma
(ensures subst_patterns
(subst_patterns ps [ ND x i ])
(open_with_var x i)
== ps)
(decreases ps)
= match ps with
| [] -> ()
| (p, b)::ps' ->
open_close_inverse'_pattern i p x;
let n = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_patterns (i + n) ps' x
and open_close_inverse'_pattern (i:nat) (p:pattern{ln'_pattern p (i - 1)}) (x:var)
: Lemma
(ensures subst_pattern
(subst_pattern p [ ND x i ])
(open_with_var x i)
== p)
(decreases p)
= match p with
| Pat_Constant _ -> ()
| Pat_Cons fv us pats ->
open_close_inverse'_patterns i pats x
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
match topt with
| None -> ()
| Some t -> open_close_inverse' i t x
and open_close_inverse'_branch (i:nat) (br:branch{ln'_branch br (i - 1)}) (x:var)
: Lemma
(ensures subst_branch
(subst_branch br [ ND x i ])
(open_with_var x i)
== br)
(decreases br)
= let p, t = br in
let j = binder_offset_pattern p in
binder_offset_pattern_invariant p [ ND x i ];
open_close_inverse'_pattern i p x;
open_close_inverse' (i + j) t x
and open_close_inverse'_branches (i:nat)
(brs:list branch { ln'_branches brs (i - 1) })
(x:var)
: Lemma
(ensures subst_branches
(subst_branches brs [ ND x i ])
(open_with_var x i)
== brs)
(decreases brs)
= match brs with
| [] -> ()
| br::brs ->
open_close_inverse'_branch i br x;
open_close_inverse'_branches i brs x
and open_close_inverse'_match_returns (i:nat)
(m:match_returns_ascription { ln'_match_returns m (i - 1) })
(x:var)
: Lemma
(ensures subst_match_returns
(subst_match_returns m [ ND x i ])
(open_with_var x i)
== m)
(decreases m)
= let b, (ret, as_, eq) = m in
open_close_inverse'_binder i b x;
let ret =
match ret with
| Inl t ->
open_close_inverse' (i + 1) t x
| Inr c ->
open_close_inverse'_comp (i + 1) c x
in
let as_ =
match as_ with
| None -> ()
| Some t ->
open_close_inverse' (i + 1) t x
in
()
let open_close_inverse (e:R.term { ln e }) (x:var)
: Lemma (open_term (close_term e x) x == e)
= close_term_spec e x;
open_term_spec (close_term e x) x;
open_close_inverse' 0 e x
let rec close_open_inverse' (i:nat)
(t:term)
(x:var { ~(x `Set.mem` freevars t) })
: Lemma
(ensures subst_term
(subst_term t (open_with_var x i))
[ ND x i ]
== t)
(decreases t)
= match inspect_ln t with
| Tv_Uvar _ _ -> assert false
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown -> ()
| Tv_BVar _ -> ()
| Tv_Var _ -> ()
| Tv_App t1 a ->
close_open_inverse' i t1 x;
close_open_inverse' i (fst a) x
| Tv_Abs b body ->
close_open_inverse'_binder i b x;
close_open_inverse' (i + 1) body x
| Tv_Arrow b c ->
close_open_inverse'_binder i b x;
close_open_inverse'_comp (i + 1) c x
| Tv_Refine b f ->
close_open_inverse'_binder i b x;
close_open_inverse' (i + 1) f x
| Tv_Let recf attrs b def body ->
close_open_inverse'_terms i attrs x;
close_open_inverse'_binder i b x;
close_open_inverse' (if recf then (i + 1) else i) def x;
close_open_inverse' (i + 1) body x
| Tv_Match scr ret brs ->
close_open_inverse' i scr x;
(match ret with
| None -> ()
| Some m -> close_open_inverse'_match_returns i m x);
close_open_inverse'_branches i brs x
| Tv_AscribedT e t tac b ->
close_open_inverse' i e x;
close_open_inverse' i t x;
(match tac with
| None -> ()
| Some t -> close_open_inverse' i t x)
| Tv_AscribedC e c tac b ->
close_open_inverse' i e x;
close_open_inverse'_comp i c x;
(match tac with
| None -> ()
| Some t -> close_open_inverse' i t x)
and close_open_inverse'_comp (i:nat)
(c:comp)
(x:var{ ~(x `Set.mem` freevars_comp c) })
: Lemma
(ensures subst_comp
(subst_comp c (open_with_var x i))
[ ND x i ]
== c)
(decreases c)
= match inspect_comp c with
| C_Total t
| C_GTotal t ->
close_open_inverse' i t x
| C_Lemma pre post pats ->
close_open_inverse' i pre x;
close_open_inverse' i post x;
close_open_inverse' i pats x
| C_Eff us eff_name res args decrs ->
close_open_inverse' i res x;
close_open_inverse'_args i args x;
close_open_inverse'_terms i decrs x
and close_open_inverse'_args (i:nat) (args:list argv) (x:var{ ~(x `Set.mem` freevars_args args) })
: Lemma
(ensures subst_args
(subst_args args (open_with_var x i))
[ ND x i]
== args)
(decreases args)
= match args with
| [] -> ()
| (a, q) :: args ->
close_open_inverse' i a x;
close_open_inverse'_args i args x
and close_open_inverse'_binder (i:nat) (b:binder) (x:var{ ~(x `Set.mem` freevars_binder b) })
: Lemma
(ensures subst_binder
(subst_binder b (open_with_var x i))
[ ND x i ]
== b)
(decreases b)
= let bndr = inspect_binder b in
close_open_inverse' i bndr.sort x;
close_open_inverse'_terms i bndr.attrs x;
pack_inspect_binder b
and close_open_inverse'_terms (i:nat) (ts:list term) (x:var{ ~(x `Set.mem` freevars_terms ts) })
: Lemma
(ensures subst_terms
(subst_terms ts (open_with_var x i))
[ ND x i ]
== ts)
(decreases ts)
= match ts with
| [] -> ()
| hd :: tl ->
close_open_inverse' i hd x;
close_open_inverse'_terms i tl x
and close_open_inverse'_branches (i:nat) (brs:list branch)
(x:var{ ~(x `Set.mem` freevars_branches brs) })
: Lemma
(ensures subst_branches
(subst_branches brs (open_with_var x i))
[ ND x i ]
== brs)
(decreases brs)
= match brs with
| [] -> ()
| b :: brs ->
close_open_inverse'_branch i b x;
close_open_inverse'_branches i brs x
and close_open_inverse'_branch (i:nat)
(br:branch)
(x:var{ ~(x `Set.mem` freevars_branch br) })
: Lemma
(ensures subst_branch
(subst_branch br (open_with_var x i))
[ ND x i ]
== br)
(decreases br)
= let p, t = br in
close_open_inverse'_pattern i p x;
binder_offset_pattern_invariant p (open_with_var x i);
close_open_inverse' (i + binder_offset_pattern p) t x
and close_open_inverse'_pattern (i:nat)
(p:pattern)
(x:var{ ~(x `Set.mem` freevars_pattern p) })
: Lemma
(ensures subst_pattern
(subst_pattern p (open_with_var x i))
[ ND x i ]
== p)
(decreases p)
= match p with
| Pat_Constant _ -> ()
| Pat_Cons fv us pats ->
close_open_inverse'_patterns i pats x
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
match topt with
| None -> ()
| Some t -> close_open_inverse' i t x
and close_open_inverse'_patterns (i:nat)
(ps:list (pattern & bool))
(x:var {~ (x `Set.mem` freevars_patterns ps) })
: Lemma
(ensures subst_patterns
(subst_patterns ps (open_with_var x i))
[ ND x i ]
== ps)
(decreases ps)
= match ps with
| [] -> ()
| (p, b)::ps' ->
close_open_inverse'_pattern i p x;
let n = binder_offset_pattern p in
binder_offset_pattern_invariant p (open_with_var x i);
close_open_inverse'_patterns (i + n) ps' x
and close_open_inverse'_match_returns (i:nat) (m:match_returns_ascription)
(x:var{ ~(x `Set.mem` freevars_match_returns m) })
: Lemma
(ensures subst_match_returns
(subst_match_returns m (open_with_var x i))
[ ND x i ]
== m)
(decreases m)
= let b, (ret, as_, eq) = m in
close_open_inverse'_binder i b x;
(match ret with
| Inl t -> close_open_inverse' (i + 1) t x
| Inr c -> close_open_inverse'_comp (i + 1) c x);
(match as_ with
| None -> ()
| Some t -> close_open_inverse' (i + 1) t x)
let close_open_inverse (e:R.term) (x:var {~ (x `Set.mem` freevars e) })
: Lemma (close_term (open_term e x) x == e)
= open_term_spec e x;
close_term_spec (open_term e x) x;
close_open_inverse' 0 e x
let rec close_with_not_free_var (t:R.term) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars t)))
(ensures subst_term t [ ND x i ] == t)
(decreases t) =
match inspect_ln t with
| Tv_Var _
| Tv_BVar _
| Tv_FVar _
| Tv_UInst _ _ -> ()
| Tv_App hd (arg, _) ->
close_with_not_free_var hd x i;
close_with_not_free_var arg x i
| Tv_Abs b body ->
close_binder_with_not_free_var b x i;
close_with_not_free_var body x (i + 1)
| Tv_Arrow b c ->
close_binder_with_not_free_var b x i;
close_comp_with_not_free_var c x (i + 1)
| Tv_Type _ -> ()
| Tv_Refine b t ->
close_binder_with_not_free_var b x i;
close_with_not_free_var t x (i + 1)
| Tv_Const _ -> ()
| Tv_Uvar _ _ -> assert False
| Tv_Let recf attrs b e1 e2 ->
close_terms_with_not_free_var attrs x i;
close_binder_with_not_free_var b x i;
(if recf then close_with_not_free_var e1 x (i + 1)
else close_with_not_free_var e1 x i);
close_with_not_free_var e2 x (i + 1)
| Tv_Match scrutinee ret_opt brs ->
close_with_not_free_var scrutinee x i;
(match ret_opt with
| None -> ()
| Some ret -> close_match_returns_with_not_free_var ret x i);
close_branches_with_not_free_var brs x i
| Tv_AscribedT e t tacopt _ ->
close_with_not_free_var e x i;
close_with_not_free_var t x i;
(match tacopt with
| None -> ()
| Some tac -> close_with_not_free_var tac x i)
| Tv_AscribedC e c tacopt _ ->
close_with_not_free_var e x i;
close_comp_with_not_free_var c x i;
(match tacopt with
| None -> ()
| Some tac -> close_with_not_free_var tac x i)
| Tv_Unknown -> ()
| Tv_Unsupp -> ()
and close_match_returns_with_not_free_var
(r:match_returns_ascription)
(x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_match_returns r)))
(ensures subst_match_returns r [ ND x i ] == r)
(decreases r) =
let b, (ret, as_opt, _) = r in
close_binder_with_not_free_var b x i;
(match ret with
| Inl t -> close_with_not_free_var t x (i + 1)
| Inr c -> close_comp_with_not_free_var c x (i + 1));
(match as_opt with
| None -> ()
| Some t -> close_with_not_free_var t x (i + 1))
and close_branches_with_not_free_var
(brs:list R.branch)
(x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_branches brs)))
(ensures subst_branches brs [ ND x i ] == brs)
(decreases brs) =
match brs with
| [] -> ()
| hd::tl ->
close_branch_with_not_free_var hd x i;
close_branches_with_not_free_var tl x i
and close_branch_with_not_free_var
(br:R.branch)
(x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_branch br)))
(ensures subst_branch br [ ND x i ] == br)
(decreases br) =
let p, t = br in
close_pattern_with_not_free_var p x i;
close_with_not_free_var t x (binder_offset_pattern p + i)
and close_pattern_with_not_free_var (p:R.pattern) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_pattern p)))
(ensures subst_pattern p [ ND x i ] == p)
(decreases p) =
match p with
| Pat_Constant _ -> ()
| Pat_Cons _ _ pats ->
close_patterns_with_not_free_var pats x i
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
(match topt with
| None -> ()
| Some t -> close_with_not_free_var t x i)
and close_patterns_with_not_free_var (l:list (R.pattern & bool)) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_patterns l)))
(ensures subst_patterns l [ ND x i ] == l)
(decreases l) =
match l with
| [] -> ()
| (p, _)::tl ->
close_pattern_with_not_free_var p x i;
close_patterns_with_not_free_var tl x (binder_offset_pattern p + i)
and close_terms_with_not_free_var (l:list R.term) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_terms l)))
(ensures subst_terms l [ ND x i ] == l)
(decreases l) =
match l with
| [] -> ()
| hd::tl ->
close_with_not_free_var hd x i;
close_terms_with_not_free_var tl x i
and close_binder_with_not_free_var (b:R.binder) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_binder b)))
(ensures subst_binder b [ ND x i ] == b)
(decreases b) =
let {attrs; sort} = inspect_binder b in
close_with_not_free_var sort x i;
close_terms_with_not_free_var attrs x i
and close_comp_with_not_free_var (c:R.comp) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_comp c)))
(ensures subst_comp c [ ND x i ] == c)
(decreases c) =
match inspect_comp c with
| C_Total t
| C_GTotal t -> close_with_not_free_var t x i
| C_Lemma pre post pats ->
close_with_not_free_var pre x i;
close_with_not_free_var post x i;
close_with_not_free_var pats x i
| C_Eff _ _ t args decrs ->
close_with_not_free_var t x i;
close_args_with_not_free_var args x i;
close_terms_with_not_free_var decrs x i
and close_args_with_not_free_var (l:list R.argv) (x:var) (i:nat)
: Lemma
(requires ~ (Set.mem x (freevars_args l)))
(ensures subst_args l [ ND x i ] == l)
(decreases l) =
match l with
| [] -> ()
| (t, _)::tl ->
close_with_not_free_var t x i;
close_args_with_not_free_var tl x i
let equiv_arrow #g #e1 #e2 ty q x eq =
assume (~ (x `Set.mem` (freevars e1 `Set.union` freevars e2)));
let c1 = T.E_Total, e1 in
let c2 = T.E_Total, e2 in
Rel_arrow _ _ _ _ c1 c2 _ _ (Rel_refl _ _ _) (Relc_typ _ _ _ _ _ eq)
let equiv_abs_close #g #e1 #e2 ty q x eq =
// TODO: the following can be the preconditions?
// or derived from equiv?
assume (ln' e1 (-1));
assume (ln' e2 (-1));
// this should be a lemma
assume (~ (x `Set.mem` (freevars (subst_term e1 [ ND x 0 ]) `Set.union`
freevars (subst_term e2 [ ND x 0 ]))));
open_close_inverse' 0 e1 x;
open_close_inverse' 0 e2 x;
let eq
: equiv (extend_env g x ty)
(subst_term
(subst_term e1 [ ND x 0 ])
(open_with_var x 0))
(subst_term
(subst_term e2 [ ND x 0 ])
(open_with_var x 0)) =
eq in
Rel_abs _ _ _ _ _ _ _ (Rel_refl _ _ _) eq
let rec open_with_gt_ln e i t j
: Lemma (requires ln' e i /\ i < j)
(ensures subst_term e [ DT j t ] == e)
(decreases e) =
match inspect_ln e with
| Tv_UInst _ _
| Tv_FVar _
| Tv_Type _
| Tv_Const _
| Tv_Unsupp
| Tv_Unknown
| Tv_Var _
| Tv_BVar _ -> ()
| Tv_App hd argv ->
open_with_gt_ln hd i t j;
open_with_gt_ln (fst argv) i t j
| Tv_Abs b body ->
open_with_gt_ln_binder b i t j;
open_with_gt_ln body (i + 1) t (j + 1)
| Tv_Arrow b c ->
open_with_gt_ln_binder b i t j;
open_with_gt_ln_comp c (i + 1) t (j + 1)
| Tv_Refine b f ->
open_with_gt_ln_binder b i t j;
open_with_gt_ln f (i + 1) t (j + 1)
| Tv_Uvar j c -> admit ()
| Tv_Let recf attrs b def body ->
open_with_gt_ln_terms attrs i t j;
open_with_gt_ln_binder b i t j;
(if recf
then open_with_gt_ln def (i + 1) t (j + 1)
else open_with_gt_ln def i t j);
open_with_gt_ln body (i + 1) t (j + 1)
| Tv_Match scr ret brs ->
open_with_gt_ln scr i t j;
(match ret with
| None -> ()
| Some ret -> open_with_gt_ln_match_returns ret i t j);
open_with_gt_ln_branches brs i t j
| Tv_AscribedT e t1 tac _ ->
open_with_gt_ln e i t j;
open_with_gt_ln t1 i t j;
(match tac with
| None -> ()
| Some tac -> open_with_gt_ln tac i t j)
| Tv_AscribedC e c tac _ ->
open_with_gt_ln e i t j;
open_with_gt_ln_comp c i t j;
(match tac with
| None -> ()
| Some tac -> open_with_gt_ln tac i t j)
and open_with_gt_ln_binder (b:binder) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_binder b i /\ i < j)
(ensures subst_binder b [ DT j t ] == b)
(decreases b) =
let {attrs;sort} = inspect_binder b in
open_with_gt_ln sort i t j;
open_with_gt_ln_terms attrs i t j
and open_with_gt_ln_comp (c:comp) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_comp c i /\ i < j)
(ensures subst_comp c [ DT j t ] == c)
(decreases c) =
match inspect_comp c with
| C_Total t1
| C_GTotal t1 -> open_with_gt_ln t1 i t j
| C_Lemma pre post pats ->
open_with_gt_ln pre i t j;
open_with_gt_ln post i t j;
open_with_gt_ln pats i t j
| C_Eff _ _ res args decrs ->
open_with_gt_ln res i t j;
open_args_with_gt_ln_args args i t j;
open_with_gt_ln_terms decrs i t j
and open_with_gt_ln_terms (l:list term) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_terms l i /\ i < j)
(ensures subst_terms l [ DT j t ] == l)
(decreases l) =
match l with
| [] -> ()
| hd::tl ->
open_with_gt_ln hd i t j;
open_with_gt_ln_terms tl i t j
and open_with_gt_ln_match_returns (m:match_returns_ascription) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_match_returns m i /\ i < j)
(ensures subst_match_returns m [ DT j t ] == m)
(decreases m) =
let b, (ret, as_, _) = m in
open_with_gt_ln_binder b i t j;
(match ret with
| Inl t1 -> open_with_gt_ln t1 (i + 1) t (j + 1)
| Inr c -> open_with_gt_ln_comp c (i + 1) t (j + 1));
(match as_ with
| None -> ()
| Some t1 -> open_with_gt_ln t1 (i + 1) t (j + 1))
and open_with_gt_ln_branches (l:list branch) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_branches l i /\ i < j)
(ensures subst_branches l [ DT j t ] == l)
(decreases l) =
match l with
| [] -> ()
| hd::tl ->
open_with_gt_ln_branch hd i t j;
open_with_gt_ln_branches tl i t j
and open_args_with_gt_ln_args (l:list argv) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_args l i /\ i < j)
(ensures subst_args l [ DT j t ] == l)
(decreases l) =
match l with
| [] -> ()
| (t1, _)::tl ->
open_with_gt_ln t1 i t j;
open_args_with_gt_ln_args tl i t j
and open_with_gt_ln_branch (b:branch) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_branch b i /\ i < j)
(ensures subst_branch b [ DT j t ] == b)
(decreases b) =
let p, t1 = b in
open_with_gt_ln_pat p i t j;
let k = binder_offset_pattern p in
open_with_gt_ln t1 (i + k) t (j + k)
and open_with_gt_ln_pat (p:pattern) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_pattern p i /\ i < j)
(ensures subst_pattern p [ DT j t ] == p)
(decreases p) =
match p with
| Pat_Constant _ -> ()
| Pat_Cons _ _ pats ->
open_with_gt_ln_pats pats i t j
| Pat_Var bv _ -> ()
| Pat_Dot_Term topt ->
(match topt with
| None -> ()
| Some t1 -> open_with_gt_ln t1 i t j)
and open_with_gt_ln_pats (l:list (pattern & bool)) (i:nat) (t:term) (j:nat)
: Lemma (requires ln'_patterns l i /\ i < j)
(ensures subst_patterns l [ DT j t ] == l)
(decreases l) =
match l with
| [] -> ()
| hd::tl ->
open_with_gt_ln_pat (fst hd) i t j;
let k = binder_offset_pattern (fst hd) in
open_with_gt_ln_pats tl (i + k) t (j + k)
let if_complete_match (g:env) (t:term) = magic()
let mkif
(g:fstar_env)
(scrutinee:term)
(then_:term)
(else_:term)
(ty:term)
(u_ty:universe)
(hyp:var { None? (lookup_bvar g hyp) /\ ~(hyp `Set.mem` (freevars then_ `Set.union` freevars else_)) })
(eff:T.tot_or_ghost)
(ty_eff:T.tot_or_ghost)
(ts : typing g scrutinee (eff, bool_ty))
(tt : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool)) then_ (eff, ty))
(te : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool)) else_ (eff, ty))
(tr : typing g ty (ty_eff, tm_type u_ty)) | false | false | FStar.Reflection.Typing.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 mkif
(g:fstar_env)
(scrutinee:term)
(then_:term)
(else_:term)
(ty:term)
(u_ty:universe)
(hyp:var { None? (lookup_bvar g hyp) /\ ~(hyp `Set.mem` (freevars then_ `Set.union` freevars else_)) })
(eff:T.tot_or_ghost)
(ty_eff:T.tot_or_ghost)
(ts : typing g scrutinee (eff, bool_ty))
(tt : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee true_bool)) then_ (eff, ty))
(te : typing (extend_env g hyp (eq2 (pack_universe Uv_Zero) bool_ty scrutinee false_bool)) else_ (eff, ty))
(tr : typing g ty (ty_eff, tm_type u_ty))
: typing g (mk_if scrutinee then_ else_) (eff, ty) | [] | FStar.Reflection.Typing.mkif | {
"file_name": "ulib/experimental/FStar.Reflection.Typing.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} |
g: FStar.Reflection.Typing.fstar_env ->
scrutinee: FStar.Reflection.Types.term ->
then_: FStar.Reflection.Types.term ->
else_: FStar.Reflection.Types.term ->
ty: FStar.Reflection.Types.term ->
u_ty: FStar.Reflection.Types.universe ->
hyp:
FStar.Reflection.V2.Data.var
{ None? (FStar.Reflection.Typing.lookup_bvar g hyp) /\
~(FStar.Set.mem hyp
(FStar.Set.union (FStar.Reflection.Typing.freevars then_)
(FStar.Reflection.Typing.freevars else_))) } ->
eff: FStar.Stubs.TypeChecker.Core.tot_or_ghost ->
ty_eff: FStar.Stubs.TypeChecker.Core.tot_or_ghost ->
ts: FStar.Reflection.Typing.typing g scrutinee (eff, FStar.Reflection.Typing.bool_ty) ->
tt:
FStar.Reflection.Typing.typing (FStar.Reflection.Typing.extend_env g
hyp
(FStar.Reflection.Typing.eq2 (FStar.Reflection.V2.Builtins.pack_universe FStar.Reflection.V2.Data.Uv_Zero
)
FStar.Reflection.Typing.bool_ty
scrutinee
FStar.Reflection.Typing.true_bool))
then_
(eff, ty) ->
te:
FStar.Reflection.Typing.typing (FStar.Reflection.Typing.extend_env g
hyp
(FStar.Reflection.Typing.eq2 (FStar.Reflection.V2.Builtins.pack_universe FStar.Reflection.V2.Data.Uv_Zero
)
FStar.Reflection.Typing.bool_ty
scrutinee
FStar.Reflection.Typing.false_bool))
else_
(eff, ty) ->
tr: FStar.Reflection.Typing.typing g ty (ty_eff, FStar.Reflection.Typing.tm_type u_ty)
-> FStar.Reflection.Typing.typing g
(FStar.Reflection.Typing.mk_if scrutinee then_ else_)
(eff, ty) | {
"end_col": 13,
"end_line": 971,
"start_col": 1,
"start_line": 955
} |
Prims.GTot | val validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0 | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": 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 validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
= let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\
live_slice h0 sl /\
B.live h1 bpos /\
B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\ (
let pos1 = Seq.index (B.as_seq h bpos) 0 in
if
is_error pos1
then
stop == true /\
(~ (valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\
U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==> valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)
) | val validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0 = | false | null | false | let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\ k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\ live_slice h0 sl /\ B.live h1 bpos /\ B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\
(let pos1 = Seq.index (B.as_seq h bpos) 0 in
if is_error pos1
then stop == true /\ (~(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\ U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==>
valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)) | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"sometrivial"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Ghost.erased",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"LowParse.Low.ErrorCode.pos_t",
"LowStar.Buffer.pointer",
"FStar.UInt64.t",
"Prims.bool",
"Prims.l_and",
"LowStar.Monotonic.Buffer.disjoint",
"LowParse.Slice.buffer_srel_of_srel",
"LowStar.Buffer.trivial_preorder",
"LowParse.Slice.__proj__Mkslice__item__base",
"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",
"Prims.b2t",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.v",
"FStar.UInt32.v",
"LowParse.Slice.__proj__Mkslice__item__len",
"LowParse.Slice.live_slice",
"LowStar.Monotonic.Buffer.live",
"LowStar.Monotonic.Buffer.modifies",
"LowStar.Monotonic.Buffer.loc_none",
"LowStar.Monotonic.Buffer.loc_buffer",
"LowParse.Low.ErrorCode.is_error",
"Prims.l_not",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"Prims.l_iff",
"Prims.l_imp",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.UInt64.n",
"Prims.logical",
"FStar.Seq.Base.index",
"LowStar.Monotonic.Buffer.as_seq",
"FStar.Ghost.reveal"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool) | false | false | LowParse.Low.List.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 validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0 | [] | LowParse.Low.List.validate_list_inv | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
g0: FStar.Ghost.erased FStar.Monotonic.HyperStack.mem ->
g1: FStar.Ghost.erased FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos0: LowParse.Low.ErrorCode.pos_t ->
bpos: LowStar.Buffer.pointer FStar.UInt64.t ->
h: FStar.Monotonic.HyperStack.mem ->
stop: Prims.bool
-> Prims.GTot Type0 | {
"end_col": 3,
"end_line": 301,
"start_col": 1,
"start_line": 280
} |
FStar.Pervasives.Lemma | val valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (valid (parse_list p) h sl pos /\ contents (parse_list p) h sl pos == [])) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos | val valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (valid (parse_list p) h sl pos /\ contents (parse_list p) h sl pos == []))
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (valid (parse_list p) h sl pos /\ contents (parse_list p) h sl pos == [])) = | false | null | true | parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.contents_eq",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_equiv",
"LowParse.Spec.List.parse_list_eq",
"LowParse.Slice.bytes_of_slice_from",
"Prims.l_and",
"Prims.eq2",
"FStar.UInt.uint_t",
"FStar.UInt32.n",
"FStar.UInt32.v",
"LowParse.Slice.__proj__Mkslice__item__len",
"LowParse.Slice.live_slice",
"Prims.squash",
"LowParse.Low.Base.Spec.valid",
"LowParse.Low.Base.Spec.contents",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == [] | false | false | LowParse.Low.List.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 valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (valid (parse_list p) h sl pos /\ contents (parse_list p) h sl pos == [])) | [] | LowParse.Low.List.valid_list_intro_nil | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
FStar.UInt32.v pos == FStar.UInt32.v (Mkslice?.len sl) /\ LowParse.Slice.live_slice h sl)
(ensures
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p) h sl pos /\
LowParse.Low.Base.Spec.contents (LowParse.Spec.List.parse_list p) h sl pos == []) | {
"end_col": 37,
"end_line": 49,
"start_col": 2,
"start_line": 47
} |
FStar.Pervasives.Lemma | val valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(valid_exact (parse_list p) h sl pos pos /\ contents_exact (parse_list p) h sl pos pos == []
)) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos | val valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(valid_exact (parse_list p) h sl pos pos /\ contents_exact (parse_list p) h sl pos pos == []
))
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(valid_exact (parse_list p) h sl pos pos /\ contents_exact (parse_list p) h sl pos pos == []
)) = | false | null | true | parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.contents_exact_eq",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_exact_equiv",
"LowParse.Spec.List.parse_list_eq",
"LowParse.Low.Base.Spec.bytes_of_slice_from_to",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt32.v",
"LowParse.Slice.__proj__Mkslice__item__len",
"LowParse.Slice.live_slice",
"Prims.squash",
"LowParse.Low.Base.Spec.valid_exact",
"Prims.eq2",
"LowParse.Low.Base.Spec.contents_exact",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == [] | false | false | LowParse.Low.List.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 valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(valid_exact (parse_list p) h sl pos pos /\ contents_exact (parse_list p) h sl pos pos == []
)) | [] | LowParse.Low.List.valid_exact_list_nil | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
FStar.UInt32.v pos <= FStar.UInt32.v (Mkslice?.len sl) /\ LowParse.Slice.live_slice h sl)
(ensures
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos pos == []) | {
"end_col": 47,
"end_line": 31,
"start_col": 2,
"start_line": 29
} |
FStar.Pervasives.Lemma | val valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos < U32.v sl.len /\ valid (parse_list p) h sl pos))
(ensures (valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos))) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1 | val valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos < U32.v sl.len /\ valid (parse_list p) h sl pos))
(ensures (valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos)))
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos < U32.v sl.len /\ valid (parse_list p) h sl pos))
(ensures (valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos))) = | false | null | true | let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1 | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"LowParse.Low.Base.Spec.get_valid_pos",
"Prims.unit",
"LowParse.Spec.List.parse_list_eq",
"LowParse.Bytes.bytes",
"LowParse.Slice.bytes_of_slice_from",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.UInt32.v",
"LowParse.Slice.__proj__Mkslice__item__len",
"LowParse.Low.Base.Spec.valid",
"Prims.squash",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) | false | false | LowParse.Low.List.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 valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma (requires (U32.v pos < U32.v sl.len /\ valid (parse_list p) h sl pos))
(ensures (valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos))) | [] | LowParse.Low.List.valid_list_elim_cons | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
FStar.UInt32.v pos < FStar.UInt32.v (Mkslice?.len sl) /\
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p) h sl pos)
(ensures
LowParse.Low.Base.Spec.valid p h sl pos /\
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos)) | {
"end_col": 38,
"end_line": 137,
"start_col": 1,
"start_line": 132
} |
Prims.Tot | val validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0))
: Tot (validator (parse_list p)) | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": 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 validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0
))
: Tot (validator (parse_list p))
= fun
(#rrel #rel: _)
(sl: slice rrel rel)
pos ->
let h = HST.get () in
valid_valid_exact_consumes_all (parse_list p) h sl (uint64_to_uint32 pos);
validate_list' v sl pos | val validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0))
: Tot (validator (parse_list p))
let validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0))
: Tot (validator (parse_list p)) = | false | null | false | fun (#rrel: _) (#rel: _) (sl: slice rrel rel) pos ->
let h = HST.get () in
valid_valid_exact_consumes_all (parse_list p) h sl (uint64_to_uint32 pos);
validate_list' v sl pos | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"total"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Low.Base.validator",
"Prims.squash",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt64.t",
"LowParse.Low.List.validate_list'",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_valid_exact_consumes_all",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
= let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\
live_slice h0 sl /\
B.live h1 bpos /\
B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\ (
let pos1 = Seq.index (B.as_seq h bpos) 0 in
if
is_error pos1
then
stop == true /\
(~ (valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\
U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==> valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)
)
inline_for_extraction
let validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures (fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res
))
= let pos1 = B.index bpos 0ul in
assert (U64.v pos1 <= U32.v sl.len);
if pos1 = Cast.uint32_to_uint64 sl.len
then true
else begin
Classical.move_requires (valid_exact_list_cons p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
Classical.move_requires (valid_exact_list_cons_recip p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
let pos1 = v sl pos1 in
B.upd bpos 0ul pos1;
is_error pos1
end
inline_for_extraction
let validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires (fun h ->
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\
live_slice h sl
))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
(* we could return a boolean, but we would like to return the last
validation error code if it fails. (alas, we cannot capture
that fact in the spec.) *)
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len)
))
= let h0 = HST.get () in
let g0 = G.hide h0 in
HST.push_frame ();
let h02 = HST.get () in
B.fresh_frame_modifies h0 h02;
let bpos = B.alloca pos 1ul in
let h1 = HST.get () in
let g1 = G.hide h1 in
C.Loops.do_while (validate_list_inv p g0 g1 sl pos bpos) (fun _ -> validate_list_body v g0 g1 sl pos bpos);
valid_exact_list_nil p h0 sl sl.len;
let posf = B.index bpos 0ul in
HST.pop_frame ();
posf
inline_for_extraction
let validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0
)) | false | false | LowParse.Low.List.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 validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0))
: Tot (validator (parse_list p)) | [] | LowParse.Low.List.validate_list | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
v: LowParse.Low.Base.validator p ->
u118:
Prims.squash (Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\
Mkparser_kind'?.parser_kind_low k > 0)
-> LowParse.Low.Base.validator (LowParse.Spec.List.parse_list p) | {
"end_col": 25,
"end_line": 387,
"start_col": 2,
"start_line": 381
} |
FStar.Pervasives.Lemma | val valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma
(requires
(U32.v pos < U32.v sl.len /\ valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)))
(ensures
(valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos ==
contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos))) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1 | val valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma
(requires
(U32.v pos < U32.v sl.len /\ valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)))
(ensures
(valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos ==
contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)))
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma
(requires
(U32.v pos < U32.v sl.len /\ valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)))
(ensures
(valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos ==
contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos))) = | false | null | true | let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1 | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Spec.List.parse_list_eq",
"LowParse.Bytes.bytes",
"LowParse.Slice.bytes_of_slice_from",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.UInt32.v",
"LowParse.Slice.__proj__Mkslice__item__len",
"LowParse.Low.Base.Spec.valid",
"Prims.squash",
"Prims.eq2",
"LowParse.Low.Base.Spec.contents",
"Prims.Cons",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos) | false | false | LowParse.Low.List.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 valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: U32.t)
: Lemma
(requires
(U32.v pos < U32.v sl.len /\ valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)))
(ensures
(valid p h sl pos /\ valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos ==
contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos))) | [] | LowParse.Low.List.valid_list_intro_cons | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
FStar.UInt32.v pos < FStar.UInt32.v (Mkslice?.len sl) /\
LowParse.Low.Base.Spec.valid p h sl pos /\
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos))
(ensures
LowParse.Low.Base.Spec.valid p h sl pos /\
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos) /\
LowParse.Low.Base.Spec.valid (LowParse.Spec.List.parse_list p) h sl pos /\
LowParse.Low.Base.Spec.contents (LowParse.Spec.List.parse_list p) h sl pos ==
LowParse.Low.Base.Spec.contents p h sl pos ::
LowParse.Low.Base.Spec.contents (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos)) | {
"end_col": 38,
"end_line": 113,
"start_col": 1,
"start_line": 108
} |
FStar.Pervasives.Lemma | val serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma (requires (serialize_list_precond k))
(ensures (serialized_list_length s l == Seq.length (serialize (serialize_list _ s) l))) | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma
(requires (
serialize_list_precond k
))
(ensures (serialized_list_length s l == Seq.length (serialize (serialize_list _ s) l)))
= match l with
| [] ->
serialize_list_nil _ s;
serialized_list_length_nil s
| a :: q ->
serialize_list_cons _ s a q;
serialized_list_length_cons s a q;
serialized_list_length_eq_length_serialize_list s q;
serialized_length_eq s a | val serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma (requires (serialize_list_precond k))
(ensures (serialized_list_length s l == Seq.length (serialize (serialize_list _ s) l)))
let rec serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma (requires (serialize_list_precond k))
(ensures (serialized_list_length s l == Seq.length (serialize (serialize_list _ s) l))) = | false | null | true | match l with
| [] ->
serialize_list_nil _ s;
serialized_list_length_nil s
| a :: q ->
serialize_list_cons _ s a q;
serialized_list_length_cons s a q;
serialized_list_length_eq_length_serialize_list s q;
serialized_length_eq s a | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Spec.Base.serializer",
"Prims.list",
"LowParse.Low.Base.Spec.serialized_list_length_nil",
"Prims.unit",
"LowParse.Spec.List.serialize_list_nil",
"LowParse.Low.Base.Spec.serialized_length_eq",
"LowParse.Low.List.serialized_list_length_eq_length_serialize_list",
"LowParse.Low.Base.Spec.serialized_list_length_cons",
"LowParse.Spec.List.serialize_list_cons",
"Prims.b2t",
"LowParse.Spec.List.serialize_list_precond",
"Prims.squash",
"Prims.eq2",
"Prims.nat",
"LowParse.Low.Base.Spec.serialized_list_length",
"FStar.Seq.Base.length",
"LowParse.Bytes.byte",
"LowParse.Spec.Base.serialize",
"LowParse.Spec.List.parse_list_kind",
"LowParse.Spec.List.parse_list",
"LowParse.Spec.List.serialize_list",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
= let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\
live_slice h0 sl /\
B.live h1 bpos /\
B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\ (
let pos1 = Seq.index (B.as_seq h bpos) 0 in
if
is_error pos1
then
stop == true /\
(~ (valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\
U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==> valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)
)
inline_for_extraction
let validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures (fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res
))
= let pos1 = B.index bpos 0ul in
assert (U64.v pos1 <= U32.v sl.len);
if pos1 = Cast.uint32_to_uint64 sl.len
then true
else begin
Classical.move_requires (valid_exact_list_cons p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
Classical.move_requires (valid_exact_list_cons_recip p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
let pos1 = v sl pos1 in
B.upd bpos 0ul pos1;
is_error pos1
end
inline_for_extraction
let validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires (fun h ->
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\
live_slice h sl
))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
(* we could return a boolean, but we would like to return the last
validation error code if it fails. (alas, we cannot capture
that fact in the spec.) *)
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len)
))
= let h0 = HST.get () in
let g0 = G.hide h0 in
HST.push_frame ();
let h02 = HST.get () in
B.fresh_frame_modifies h0 h02;
let bpos = B.alloca pos 1ul in
let h1 = HST.get () in
let g1 = G.hide h1 in
C.Loops.do_while (validate_list_inv p g0 g1 sl pos bpos) (fun _ -> validate_list_body v g0 g1 sl pos bpos);
valid_exact_list_nil p h0 sl sl.len;
let posf = B.index bpos 0ul in
HST.pop_frame ();
posf
inline_for_extraction
let validate_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(u: squash (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0
))
: Tot (validator (parse_list p))
= fun
(#rrel #rel: _)
(sl: slice rrel rel)
pos ->
let h = HST.get () in
valid_valid_exact_consumes_all (parse_list p) h sl (uint64_to_uint32 pos);
validate_list' v sl pos
let rec serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma
(requires (
serialize_list_precond k
)) | false | false | LowParse.Low.List.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 serialized_list_length_eq_length_serialize_list
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(s: serializer p)
(l: list t)
: Lemma (requires (serialize_list_precond k))
(ensures (serialized_list_length s l == Seq.length (serialize (serialize_list _ s) l))) | [
"recursion"
] | LowParse.Low.List.serialized_list_length_eq_length_serialize_list | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | s: LowParse.Spec.Base.serializer p -> l: Prims.list t
-> FStar.Pervasives.Lemma (requires LowParse.Spec.List.serialize_list_precond k)
(ensures
LowParse.Low.Base.Spec.serialized_list_length s l ==
FStar.Seq.Base.length (LowParse.Spec.Base.serialize (LowParse.Spec.List.serialize_list p s)
l)) | {
"end_col": 28,
"end_line": 408,
"start_col": 2,
"start_line": 400
} |
FStar.Pervasives.Lemma | val valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos')
) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos' | val valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos')
)
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos')
) = | false | null | true | let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos' | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.contents_exact_eq",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_exact_equiv",
"Prims._assert",
"LowParse.Spec.Base.injective_postcond",
"LowParse.Spec.Base.no_lookahead_on",
"LowParse.Spec.Base.parser_kind_prop_equiv",
"LowParse.Bytes.bytes",
"LowParse.Slice.bytes_of_slice_from",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Spec.List.parse_list_eq'",
"LowParse.Low.Base.Spec.bytes_of_slice_from_to",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Low.Base.Spec.valid",
"LowParse.Low.Base.Spec.valid_exact",
"Prims.squash",
"LowParse.Low.Base.Spec.contents_exact",
"Prims.Cons",
"LowParse.Low.Base.Spec.contents",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' | false | false | LowParse.Low.List.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 valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\ valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos')
) | [] | LowParse.Low.List.valid_exact_list_cons | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t ->
pos': FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\
Mkparser_kind'?.parser_kind_low k > 0 /\ LowParse.Low.Base.Spec.valid p h sl pos /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos)
pos')
(ensures
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\
Mkparser_kind'?.parser_kind_low k > 0 /\ LowParse.Low.Base.Spec.valid p h sl pos /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos)
pos' /\ LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos' /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos pos' ==
LowParse.Low.Base.Spec.contents p h sl pos ::
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p)
h
sl
(LowParse.Low.Base.Spec.get_valid_pos p h sl pos)
pos') | {
"end_col": 49,
"end_line": 86,
"start_col": 1,
"start_line": 75
} |
FStar.Pervasives.Lemma | val valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos' | val valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos))
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) = | false | null | true | valid_list_equiv p h sl pos pos';
if pos = pos'
then valid_exact_list_nil p h sl pos
else
(valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos');
contents_list_eq p h sl pos pos' | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma",
""
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.contents_list_eq",
"Prims.unit",
"Prims.op_Equality",
"LowParse.Low.List.valid_exact_list_nil",
"Prims.bool",
"LowParse.Low.List.valid_exact_list_valid_list",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Low.List.valid_exact_list_cons_recip",
"LowParse.Low.Base.Spec.valid_list_equiv",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.squash",
"LowParse.Low.Base.Spec.valid_list",
"LowParse.Low.Base.Spec.contents_exact",
"LowParse.Low.Base.Spec.contents_list",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
)) | false | false | LowParse.Low.List.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 valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) | [
"recursion"
] | LowParse.Low.List.valid_exact_list_valid_list | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t ->
pos': FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\
Mkparser_kind'?.parser_kind_low k > 0 /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos')
(ensures
LowParse.Low.Base.Spec.valid_list p h sl pos pos' /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos pos' ==
LowParse.Low.Base.Spec.contents_list p h sl pos pos')
(decreases FStar.UInt32.v pos' - FStar.UInt32.v pos) | {
"end_col": 34,
"end_line": 233,
"start_col": 2,
"start_line": 224
} |
FStar.Pervasives.Lemma | val valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma (requires (valid_list p h sl pos pos'))
(ensures
(valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end | val valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma (requires (valid_list p h sl pos pos'))
(ensures
(valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos))
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma (requires (valid_list p h sl pos pos'))
(ensures
(valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) = | false | null | true | valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos';
if pos = pos'
then valid_exact_list_nil p h sl pos
else
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos' | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma",
""
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"Prims.op_Equality",
"LowParse.Low.List.valid_exact_list_nil",
"Prims.bool",
"LowParse.Low.List.valid_exact_list_cons",
"Prims.unit",
"LowParse.Low.List.valid_list_valid_exact_list",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Low.Base.Spec.contents_list_eq",
"LowParse.Low.Base.Spec.valid_list_equiv",
"LowParse.Low.Base.Spec.valid_list",
"Prims.squash",
"Prims.l_and",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.eq2",
"LowParse.Low.Base.Spec.contents_exact",
"LowParse.Low.Base.Spec.contents_list",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
)) | false | false | LowParse.Low.List.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 valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma (requires (valid_list p h sl pos pos'))
(ensures
(valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'))
(decreases (U32.v pos' - U32.v pos)) | [
"recursion"
] | LowParse.Low.List.valid_list_valid_exact_list | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t ->
pos': FStar.UInt32.t
-> FStar.Pervasives.Lemma (requires LowParse.Low.Base.Spec.valid_list p h sl pos pos')
(ensures
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos' /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos pos' ==
LowParse.Low.Base.Spec.contents_list p h sl pos pos')
(decreases FStar.UInt32.v pos' - FStar.UInt32.v pos) | {
"end_col": 5,
"end_line": 165,
"start_col": 2,
"start_line": 157
} |
FStar.HyperStack.ST.Stack | val validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures
(fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res)) | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": 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 validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures (fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res
))
= let pos1 = B.index bpos 0ul in
assert (U64.v pos1 <= U32.v sl.len);
if pos1 = Cast.uint32_to_uint64 sl.len
then true
else begin
Classical.move_requires (valid_exact_list_cons p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
Classical.move_requires (valid_exact_list_cons_recip p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
let pos1 = v sl pos1 in
B.upd bpos 0ul pos1;
is_error pos1
end | val validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures
(fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res))
let validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures
(fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res)) = | true | null | false | let pos1 = B.index bpos 0ul in
assert (U64.v pos1 <= U32.v sl.len);
if pos1 = Cast.uint32_to_uint64 sl.len
then true
else
(Classical.move_requires (valid_exact_list_cons p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
Classical.move_requires (valid_exact_list_cons_recip p (G.reveal g0) sl (uint64_to_uint32 pos1))
sl.len;
let pos1 = v sl pos1 in
B.upd bpos 0ul pos1;
is_error pos1) | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Low.Base.validator",
"FStar.Ghost.erased",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"LowParse.Low.ErrorCode.pos_t",
"LowStar.Buffer.pointer",
"FStar.UInt64.t",
"Prims.op_Equality",
"FStar.Int.Cast.uint32_to_uint64",
"LowParse.Slice.__proj__Mkslice__item__len",
"Prims.bool",
"LowParse.Low.ErrorCode.is_error",
"Prims.unit",
"LowStar.Monotonic.Buffer.upd",
"LowStar.Buffer.trivial_preorder",
"FStar.UInt32.__uint_to_t",
"FStar.Classical.move_requires",
"FStar.UInt32.t",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_disEquality",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"FStar.Ghost.reveal",
"LowParse.Low.Base.Spec.valid",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Low.Base.Spec.contents_exact",
"Prims.Cons",
"LowParse.Low.Base.Spec.contents",
"LowParse.Low.List.valid_exact_list_cons_recip",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Low.List.valid_exact_list_cons",
"Prims._assert",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.v",
"FStar.UInt32.v",
"LowStar.Monotonic.Buffer.index",
"LowParse.Low.List.validate_list_inv"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
= let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\
live_slice h0 sl /\
B.live h1 bpos /\
B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\ (
let pos1 = Seq.index (B.as_seq h bpos) 0 in
if
is_error pos1
then
stop == true /\
(~ (valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\
U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==> valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)
)
inline_for_extraction
let validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures (fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res | false | false | LowParse.Low.List.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 validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures
(fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res)) | [] | LowParse.Low.List.validate_list_body | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
v: LowParse.Low.Base.validator p ->
g0: FStar.Ghost.erased FStar.Monotonic.HyperStack.mem ->
g1: FStar.Ghost.erased FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos0: LowParse.Low.ErrorCode.pos_t ->
bpos: LowStar.Buffer.pointer FStar.UInt64.t
-> FStar.HyperStack.ST.Stack Prims.bool | {
"end_col": 5,
"end_line": 330,
"start_col": 1,
"start_line": 320
} |
FStar.Pervasives.Lemma | val valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3: U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\ valid_exact (parse_list p) h sl pos2 pos3))
(ensures
(valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 ==
(contents_exact (parse_list p) h sl pos1 pos2)
`L.append`
(contents_exact (parse_list p) h sl pos2 pos3)))
(decreases (U32.v pos2 - U32.v pos1)) | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end | val valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3: U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\ valid_exact (parse_list p) h sl pos2 pos3))
(ensures
(valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 ==
(contents_exact (parse_list p) h sl pos1 pos2)
`L.append`
(contents_exact (parse_list p) h sl pos2 pos3)))
(decreases (U32.v pos2 - U32.v pos1))
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3: U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\ valid_exact (parse_list p) h sl pos2 pos3))
(ensures
(valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 ==
(contents_exact (parse_list p) h sl pos1 pos2)
`L.append`
(contents_exact (parse_list p) h sl pos2 pos3)))
(decreases (U32.v pos2 - U32.v pos1)) = | false | null | true | if pos1 = pos2
then valid_exact_list_nil p h sl pos1
else
(valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3) | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma",
""
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"Prims.op_Equality",
"LowParse.Low.List.valid_exact_list_nil",
"Prims.bool",
"LowParse.Low.List.valid_exact_list_cons",
"Prims.unit",
"LowParse.Low.List.valid_exact_list_append",
"LowParse.Low.Base.Spec.get_valid_pos",
"LowParse.Low.List.valid_exact_list_cons_recip",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.squash",
"LowParse.Low.Base.Spec.contents_exact",
"FStar.List.Tot.Base.append",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
)) | false | false | LowParse.Low.List.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 valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3: U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\ valid_exact (parse_list p) h sl pos2 pos3))
(ensures
(valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 ==
(contents_exact (parse_list p) h sl pos1 pos2)
`L.append`
(contents_exact (parse_list p) h sl pos2 pos3)))
(decreases (U32.v pos2 - U32.v pos1)) | [
"recursion"
] | LowParse.Low.List.valid_exact_list_append | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos1: FStar.UInt32.t ->
pos2: FStar.UInt32.t ->
pos3: FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\
Mkparser_kind'?.parser_kind_low k > 0 /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos2 /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos2 pos3)
(ensures
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos3 /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos3 ==
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos2 @
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos2 pos3)
(decreases FStar.UInt32.v pos2 - FStar.UInt32.v pos1) | {
"end_col": 5,
"end_line": 265,
"start_col": 2,
"start_line": 257
} |
FStar.HyperStack.ST.Stack | val validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires
(fun h ->
k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len))) | [
{
"abbrev": true,
"full_module": "FStar.List.Tot",
"short_module": "L"
},
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": 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 validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires (fun h ->
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\
live_slice h sl
))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
(* we could return a boolean, but we would like to return the last
validation error code if it fails. (alas, we cannot capture
that fact in the spec.) *)
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len)
))
= let h0 = HST.get () in
let g0 = G.hide h0 in
HST.push_frame ();
let h02 = HST.get () in
B.fresh_frame_modifies h0 h02;
let bpos = B.alloca pos 1ul in
let h1 = HST.get () in
let g1 = G.hide h1 in
C.Loops.do_while (validate_list_inv p g0 g1 sl pos bpos) (fun _ -> validate_list_body v g0 g1 sl pos bpos);
valid_exact_list_nil p h0 sl sl.len;
let posf = B.index bpos 0ul in
HST.pop_frame ();
posf | val validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires
(fun h ->
k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len)))
let validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires
(fun h ->
k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len))) = | true | null | false | let h0 = HST.get () in
let g0 = G.hide h0 in
HST.push_frame ();
let h02 = HST.get () in
B.fresh_frame_modifies h0 h02;
let bpos = B.alloca pos 1ul in
let h1 = HST.get () in
let g1 = G.hide h1 in
C.Loops.do_while (validate_list_inv p g0 g1 sl pos bpos)
(fun _ -> validate_list_body v g0 g1 sl pos bpos);
valid_exact_list_nil p h0 sl sl.len;
let posf = B.index bpos 0ul in
HST.pop_frame ();
posf | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"LowParse.Low.Base.validator",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"LowParse.Low.ErrorCode.pos_t",
"FStar.UInt64.t",
"Prims.unit",
"FStar.HyperStack.ST.pop_frame",
"LowStar.Monotonic.Buffer.index",
"LowStar.Buffer.trivial_preorder",
"FStar.UInt32.__uint_to_t",
"LowParse.Low.List.valid_exact_list_nil",
"LowParse.Slice.__proj__Mkslice__item__len",
"C.Loops.do_while",
"LowParse.Low.List.validate_list_inv",
"LowParse.Low.List.validate_list_body",
"Prims.bool",
"FStar.Ghost.erased",
"FStar.Monotonic.HyperStack.mem",
"FStar.Ghost.hide",
"FStar.HyperStack.ST.get",
"LowStar.Monotonic.Buffer.mbuffer",
"Prims.l_and",
"Prims.eq2",
"Prims.nat",
"LowStar.Monotonic.Buffer.length",
"FStar.UInt32.v",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Negation",
"LowStar.Monotonic.Buffer.g_is_null",
"LowStar.Buffer.alloca",
"LowStar.Monotonic.Buffer.fresh_frame_modifies",
"FStar.HyperStack.ST.push_frame",
"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",
"Prims.op_GreaterThan",
"LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_low",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.v",
"LowParse.Slice.live_slice",
"LowStar.Monotonic.Buffer.modifies",
"LowStar.Monotonic.Buffer.loc_none",
"Prims.l_iff",
"LowParse.Low.ErrorCode.is_success",
"LowParse.Low.Base.Spec.valid_exact",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"LowParse.Low.ErrorCode.uint64_to_uint32",
"Prims.l_imp",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt64.n",
"FStar.UInt32.n"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let rec valid_exact_list_valid_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
valid_list p h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
if pos = pos'
then
valid_exact_list_nil p h sl pos
else begin
valid_exact_list_cons_recip p h sl pos pos';
let pos1 = get_valid_pos p h sl pos in
valid_exact_list_valid_list p h sl pos1 pos'
end;
contents_list_eq p h sl pos pos'
module L = FStar.List.Tot
let rec valid_exact_list_append
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos1 pos2 pos3 : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid_exact (parse_list p) h sl pos1 pos2 /\
valid_exact (parse_list p) h sl pos2 pos3
))
(ensures (
valid_exact (parse_list p) h sl pos1 pos3 /\
contents_exact (parse_list p) h sl pos1 pos3 == contents_exact (parse_list p) h sl pos1 pos2 `L.append` contents_exact (parse_list p) h sl pos2 pos3
))
(decreases (U32.v pos2 - U32.v pos1))
= if pos1 = pos2
then
valid_exact_list_nil p h sl pos1
else begin
valid_exact_list_cons_recip p h sl pos1 pos2;
let pos15 = get_valid_pos p h sl pos1 in
valid_exact_list_append p h sl pos15 pos2 pos3;
valid_exact_list_cons p h sl pos1 pos3
end
let validate_list_inv
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
(h: HS.mem)
(stop: bool)
: GTot Type0
= let h0 = G.reveal g0 in
let h1 = G.reveal g1 in
B.disjoint sl.base bpos /\
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos0 <= U32.v sl.len /\
live_slice h0 sl /\
B.live h1 bpos /\
B.modifies B.loc_none h0 h1 /\
B.modifies (B.loc_buffer bpos) h1 h /\ (
let pos1 = Seq.index (B.as_seq h bpos) 0 in
if
is_error pos1
then
stop == true /\
(~ (valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len))
else
U64.v pos0 <= U64.v pos1 /\
U64.v pos1 <= U32.v sl.len /\
(valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos0) sl.len <==> valid_exact (parse_list p) h0 sl (uint64_to_uint32 pos1) sl.len) /\
(stop == true ==> U64.v pos1 == U32.v sl.len)
)
inline_for_extraction
let validate_list_body
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(g0 g1: G.erased HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos0: pos_t)
(bpos: B.pointer U64.t)
: HST.Stack bool
(requires (fun h -> validate_list_inv p g0 g1 sl pos0 bpos h false))
(ensures (fun h res h' ->
validate_list_inv p g0 g1 sl pos0 bpos h false /\
validate_list_inv p g0 g1 sl pos0 bpos h' res
))
= let pos1 = B.index bpos 0ul in
assert (U64.v pos1 <= U32.v sl.len);
if pos1 = Cast.uint32_to_uint64 sl.len
then true
else begin
Classical.move_requires (valid_exact_list_cons p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
Classical.move_requires (valid_exact_list_cons_recip p (G.reveal g0) sl (uint64_to_uint32 pos1)) sl.len;
let pos1 = v sl pos1 in
B.upd bpos 0ul pos1;
is_error pos1
end
inline_for_extraction
let validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires (fun h ->
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\
live_slice h sl
))
(ensures (fun h res h' ->
B.modifies B.loc_none h h' /\
(* we could return a boolean, but we would like to return the last
validation error code if it fails. (alas, we cannot capture
that fact in the spec.) *)
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len) | false | false | LowParse.Low.List.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 validate_list'
(#k: parser_kind)
(#t: Type)
(#p: parser k t)
(v: validator p)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos: pos_t)
: HST.Stack U64.t
(requires
(fun h ->
k.parser_kind_subkind == Some ParserStrong /\ k.parser_kind_low > 0 /\
U64.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures
(fun h res h' ->
B.modifies B.loc_none h h' /\
(is_success res <==> valid_exact (parse_list p) h sl (uint64_to_uint32 pos) sl.len) /\
(is_success res ==> U64.v res == U32.v sl.len))) | [] | LowParse.Low.List.validate_list' | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
v: LowParse.Low.Base.validator p ->
sl: LowParse.Slice.slice rrel rel ->
pos: LowParse.Low.ErrorCode.pos_t
-> FStar.HyperStack.ST.Stack FStar.UInt64.t | {
"end_col": 6,
"end_line": 368,
"start_col": 1,
"start_line": 356
} |
FStar.Pervasives.Lemma | val valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\ valid p h sl pos /\
(let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'))) | [
{
"abbrev": true,
"full_module": "FStar.Int.Cast",
"short_module": "Cast"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "C.Loops",
"short_module": "CL"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "LowParse.Low.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec.List",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Low",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'
)))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos' | val valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\ valid p h sl pos /\
(let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos')))
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\ valid p h sl pos /\
(let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'))) = | false | null | true | let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq p sq;
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq sq0);
assert (injective_postcond p sq sq0);
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos' | {
"checked_file": "LowParse.Low.List.fst.checked",
"dependencies": [
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"LowParse.Spec.List.fsti.checked",
"LowParse.Low.Base.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"FStar.Int.Cast.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Classical.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": false,
"source_file": "LowParse.Low.List.fst"
} | [
"lemma"
] | [
"LowParse.Spec.Base.parser_kind",
"LowParse.Spec.Base.parser",
"FStar.Monotonic.HyperStack.mem",
"LowParse.Slice.srel",
"LowParse.Bytes.byte",
"LowParse.Slice.slice",
"FStar.UInt32.t",
"LowParse.Low.Base.Spec.contents_exact_eq",
"LowParse.Spec.List.parse_list_kind",
"Prims.list",
"LowParse.Spec.List.parse_list",
"Prims.unit",
"LowParse.Low.Base.Spec.valid_exact_equiv",
"LowParse.Low.Base.Spec.get_valid_pos",
"Prims._assert",
"LowParse.Spec.Base.injective_postcond",
"LowParse.Spec.Base.no_lookahead_on",
"LowParse.Spec.Base.parser_kind_prop_equiv",
"LowParse.Bytes.bytes",
"LowParse.Slice.bytes_of_slice_from",
"LowParse.Low.Base.Spec.valid_facts",
"LowParse.Spec.List.parse_list_eq",
"LowParse.Low.Base.Spec.bytes_of_slice_from_to",
"Prims.l_and",
"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",
"Prims.b2t",
"Prims.op_disEquality",
"LowParse.Low.Base.Spec.valid_exact",
"Prims.squash",
"LowParse.Low.Base.Spec.valid",
"LowParse.Low.Base.Spec.contents_exact",
"Prims.Cons",
"LowParse.Low.Base.Spec.contents",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module LowParse.Low.List
include LowParse.Spec.List
include LowParse.Low.Base
module B = LowStar.Buffer
module U32 = FStar.UInt32
module CL = C.Loops
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST
module G = FStar.Ghost
module U64 = FStar.UInt64
module Cast = FStar.Int.Cast
let valid_exact_list_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos <= U32.v sl.len /\ live_slice h sl))
(ensures (
valid_exact (parse_list p) h sl pos pos /\
contents_exact (parse_list p) h sl pos pos == []
))
= parse_list_eq p (bytes_of_slice_from_to h sl pos pos);
valid_exact_equiv (parse_list p) h sl pos pos;
contents_exact_eq (parse_list p) h sl pos pos
let valid_list_intro_nil
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (U32.v pos == U32.v sl.len /\ live_slice h sl))
(ensures (
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == []
))
= parse_list_eq p (bytes_of_slice_from h sl pos);
valid_equiv (parse_list p) h sl pos;
contents_eq (parse_list p) h sl pos
let valid_exact_list_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
k.parser_kind_low > 0 /\
valid p h sl pos /\
valid_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos' /\
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl (get_valid_pos p h sl pos) pos'
))
= let sq = bytes_of_slice_from_to h sl pos pos' in
parse_list_eq' p sq;
let pos1 = get_valid_pos p h sl pos in
valid_exact_equiv (parse_list p) h sl pos pos';
valid_facts p h sl pos;
let sq0 = bytes_of_slice_from h sl pos in
parser_kind_prop_equiv k p;
assert (no_lookahead_on p sq0 sq);
assert (injective_postcond p sq0 sq);
valid_exact_equiv (parse_list p) h sl pos1 pos';
contents_exact_eq (parse_list p) h sl pos pos';
contents_exact_eq (parse_list p) h sl pos1 pos'
let valid_list_intro_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos) /\
valid (parse_list p) h sl pos /\
contents (parse_list p) h sl pos == contents p h sl pos :: contents (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
valid_facts (parse_list p) h sl pos1
let valid_list_elim_cons
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
: Lemma
(requires (
U32.v pos < U32.v sl.len /\
valid (parse_list p) h sl pos
))
(ensures (
valid p h sl pos /\
valid (parse_list p) h sl (get_valid_pos p h sl pos)
))
= let sq = bytes_of_slice_from h sl pos in
parse_list_eq p sq;
valid_facts (parse_list p) h sl pos;
valid_facts p h sl pos;
let pos1 = get_valid_pos p h sl pos in
valid_facts (parse_list p) h sl pos1
let rec valid_list_valid_exact_list
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
valid_list p h sl pos pos'
))
(ensures (
valid_exact (parse_list p) h sl pos pos' /\
contents_exact (parse_list p) h sl pos pos' == contents_list p h sl pos pos'
))
(decreases (U32.v pos' - U32.v pos))
= valid_list_equiv p h sl pos pos';
contents_list_eq p h sl pos pos' ;
if pos = pos'
then valid_exact_list_nil p h sl pos
else begin
let pos1 = get_valid_pos p h sl pos in
valid_list_valid_exact_list p h sl pos1 pos';
valid_exact_list_cons p h sl pos pos'
end
let valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos : U32.t)
(pos' : U32.t)
: Lemma
(requires (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'
))
(ensures (
k.parser_kind_subkind == Some ParserStrong /\
pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\
valid p h sl pos /\ (
let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' == contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos' | false | false | LowParse.Low.List.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 valid_exact_list_cons_recip
(#k: parser_kind)
(#t: Type)
(p: parser k t)
(h: HS.mem)
(#rrel #rel: _)
(sl: slice rrel rel)
(pos pos': U32.t)
: Lemma
(requires
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos'))
(ensures
(k.parser_kind_subkind == Some ParserStrong /\ pos <> pos' /\
valid_exact (parse_list p) h sl pos pos' /\ valid p h sl pos /\
(let pos1 = get_valid_pos p h sl pos in
valid_exact (parse_list p) h sl pos1 pos' /\
contents_exact (parse_list p) h sl pos pos' ==
contents p h sl pos :: contents_exact (parse_list p) h sl pos1 pos'))) | [] | LowParse.Low.List.valid_exact_list_cons_recip | {
"file_name": "src/lowparse/LowParse.Low.List.fst",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} |
p: LowParse.Spec.Base.parser k t ->
h: FStar.Monotonic.HyperStack.mem ->
sl: LowParse.Slice.slice rrel rel ->
pos: FStar.UInt32.t ->
pos': FStar.UInt32.t
-> FStar.Pervasives.Lemma
(requires
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\ pos <> pos' /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos')
(ensures
Mkparser_kind'?.parser_kind_subkind k ==
FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\ pos <> pos' /\
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos pos' /\
LowParse.Low.Base.Spec.valid p h sl pos /\
(let pos1 = LowParse.Low.Base.Spec.get_valid_pos p h sl pos in
LowParse.Low.Base.Spec.valid_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos' /\
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos pos' ==
LowParse.Low.Base.Spec.contents p h sl pos ::
LowParse.Low.Base.Spec.contents_exact (LowParse.Spec.List.parse_list p) h sl pos1 pos')) | {
"end_col": 49,
"end_line": 202,
"start_col": 1,
"start_line": 191
} |
FStar.Tactics.Effect.Tac | [
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ] | let super_hack () = | true | null | false | let open FStar.Tactics in
let hash_256 = ["EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv ((cur_module ()) `FStar.List.Tot.append` ["hash_256"]) in
let t:term = pack Tv_Unknown in
let se =
pack_sigelt (Sg_Let false [pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 })])
in
[se] | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [] | [
"Prims.unit",
"Prims.Cons",
"FStar.Reflection.Types.sigelt",
"Prims.Nil",
"FStar.Reflection.V1.Builtins.pack_sigelt",
"FStar.Reflection.V1.Data.Sg_Let",
"FStar.Reflection.Types.letbinding",
"FStar.Reflection.V1.Builtins.pack_lb",
"FStar.Reflection.V1.Data.Mklb_view",
"FStar.Reflection.V1.Data.univ_name",
"Prims.list",
"FStar.Reflection.Types.term",
"FStar.Tactics.V1.Builtins.pack",
"FStar.Reflection.V1.Data.Tv_Unknown",
"FStar.Reflection.Types.fv",
"FStar.Reflection.V1.Builtins.pack_fv",
"FStar.Reflection.Types.name",
"FStar.List.Tot.Base.append",
"Prims.string",
"FStar.Tactics.V1.Derived.cur_module",
"FStar.Reflection.V1.Data.Tv_FVar"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access. | false | false | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val super_hack : _: Prims.unit -> FStar.Tactics.Effect.Tac (Prims.list FStar.Reflection.Types.sigelt) | [] | EverCrypt.HMAC.super_hack | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit -> FStar.Tactics.Effect.Tac (Prims.list FStar.Reflection.Types.sigelt) | {
"end_col": 8,
"end_line": 21,
"start_col": 2,
"start_line": 14
} |
|
Prims.Tot | val compute_sha2_256: compute_st SHA2_256 | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256 | val compute_sha2_256: compute_st SHA2_256
let compute_sha2_256 = | false | null | false | let open Hacl.Hash.SHA2 in
mk_compute (| SHA2_256, () |)
hash_256
alloca_256
init_256
EverCrypt.Hash.update_multi_256
update_last_256
finish_256 | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.SHA2_256",
"EverCrypt.HMAC.hash_256",
"Hacl.Hash.SHA2.alloca_256",
"Hacl.Hash.SHA2.init_256",
"EverCrypt.Hash.update_multi_256",
"Hacl.Hash.SHA2.update_last_256",
"Hacl.Hash.SHA2.finish_256"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 = | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_sha2_256: compute_st SHA2_256 | [] | EverCrypt.HMAC.compute_sha2_256 | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.SHA2_256 | {
"end_col": 39,
"end_line": 67,
"start_col": 2,
"start_line": 65
} |
Prims.Tot | val compute_sha1: compute_st SHA1 | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish | val compute_sha1: compute_st SHA1
let compute_sha1 = | false | null | false | let open Hacl.Hash.SHA1 in
mk_compute (| SHA1, () |)
legacy_hash
legacy_alloca
legacy_init
legacy_update_multi
legacy_update_last
legacy_finish | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.SHA1",
"Hacl.Hash.SHA1.legacy_hash",
"Hacl.Hash.Core.SHA1.legacy_alloca",
"Hacl.Hash.Core.SHA1.legacy_init",
"Hacl.Hash.SHA1.legacy_update_multi",
"Hacl.Hash.SHA1.legacy_update_last",
"Hacl.Hash.Core.SHA1.legacy_finish"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 = | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_sha1: compute_st SHA1 | [] | EverCrypt.HMAC.compute_sha1 | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.SHA1 | {
"end_col": 45,
"end_line": 58,
"start_col": 2,
"start_line": 57
} |
Prims.Tot | val compute_blake2s: compute_st Blake2S | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_blake2s =
let open Hacl.Hash.Blake2 in
mk_compute (|Blake2S, Hacl.Impl.Blake2.Core.M32|) hash_blake2s_32 alloca_blake2s_32
init_blake2s_32 update_multi_blake2s_32 update_last_blake2s_32 finish_blake2s_32 | val compute_blake2s: compute_st Blake2S
let compute_blake2s = | false | null | false | let open Hacl.Hash.Blake2 in
mk_compute (| Blake2S, Hacl.Impl.Blake2.Core.M32 |)
hash_blake2s_32
alloca_blake2s_32
init_blake2s_32
update_multi_blake2s_32
update_last_blake2s_32
finish_blake2s_32 | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.Blake2S",
"Hacl.Impl.Blake2.Core.M32",
"Hacl.Hash.Blake2.hash_blake2s_32",
"Hacl.Hash.Blake2.alloca_blake2s_32",
"Hacl.Hash.Blake2.init_blake2s_32",
"Hacl.Hash.Blake2.update_multi_blake2s_32",
"Hacl.Hash.Blake2.update_last_blake2s_32",
"Hacl.Hash.Blake2.finish_blake2s_32"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256
let compute_sha2_384 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_384, ()|) hash_384 alloca_384 init_384 update_multi_384
update_last_384 finish_384
let compute_sha2_512 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_512, ()|) hash_512 alloca_512 init_512 update_multi_512
update_last_512 finish_512
let compute_blake2s = | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_blake2s: compute_st Blake2S | [] | EverCrypt.HMAC.compute_blake2s | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.Blake2S | {
"end_col": 93,
"end_line": 84,
"start_col": 2,
"start_line": 83
} |
Prims.Tot | val compute_sha2_512: compute_st SHA2_512 | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_sha2_512 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_512, ()|) hash_512 alloca_512 init_512 update_multi_512
update_last_512 finish_512 | val compute_sha2_512: compute_st SHA2_512
let compute_sha2_512 = | false | null | false | let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (| SHA2_512, () |)
hash_512
alloca_512
init_512
update_multi_512
update_last_512
finish_512 | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.SHA2_512",
"Hacl.Streaming.SHA2.hash_512",
"Hacl.Hash.SHA2.alloca_512",
"Hacl.Hash.SHA2.init_512",
"Hacl.Hash.SHA2.update_multi_512",
"Hacl.Hash.SHA2.update_last_512",
"Hacl.Hash.SHA2.finish_512"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256
let compute_sha2_384 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_384, ()|) hash_384 alloca_384 init_384 update_multi_384
update_last_384 finish_384
let compute_sha2_512 =
let open Hacl.Streaming.SHA2 in | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_sha2_512: compute_st SHA2_512 | [] | EverCrypt.HMAC.compute_sha2_512 | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.SHA2_512 | {
"end_col": 39,
"end_line": 79,
"start_col": 2,
"start_line": 78
} |
Prims.Tot | val compute_sha2_384: compute_st SHA2_384 | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_sha2_384 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_384, ()|) hash_384 alloca_384 init_384 update_multi_384
update_last_384 finish_384 | val compute_sha2_384: compute_st SHA2_384
let compute_sha2_384 = | false | null | false | let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (| SHA2_384, () |)
hash_384
alloca_384
init_384
update_multi_384
update_last_384
finish_384 | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.SHA2_384",
"Hacl.Streaming.SHA2.hash_384",
"Hacl.Hash.SHA2.alloca_384",
"Hacl.Hash.SHA2.init_384",
"Hacl.Hash.SHA2.update_multi_384",
"Hacl.Hash.SHA2.update_last_384",
"Hacl.Hash.SHA2.finish_384"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256
let compute_sha2_384 =
let open Hacl.Streaming.SHA2 in | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_sha2_384: compute_st SHA2_384 | [] | EverCrypt.HMAC.compute_sha2_384 | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.SHA2_384 | {
"end_col": 39,
"end_line": 73,
"start_col": 2,
"start_line": 72
} |
Prims.Tot | val compute_blake2b: compute_st Blake2B | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute_blake2b =
let open Hacl.Hash.Blake2 in
mk_compute (|Blake2B, Hacl.Impl.Blake2.Core.M32|) hash_blake2b_32 alloca_blake2b_32
init_blake2b_32 update_multi_blake2b_32 update_last_blake2b_32 finish_blake2b_32 | val compute_blake2b: compute_st Blake2B
let compute_blake2b = | false | null | false | let open Hacl.Hash.Blake2 in
mk_compute (| Blake2B, Hacl.Impl.Blake2.Core.M32 |)
hash_blake2b_32
alloca_blake2b_32
init_blake2b_32
update_multi_blake2b_32
update_last_blake2b_32
finish_blake2b_32 | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"Hacl.HMAC.mk_compute",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Spec.Hash.Definitions.Blake2B",
"Hacl.Impl.Blake2.Core.M32",
"Hacl.Hash.Blake2.hash_blake2b_32",
"Hacl.Hash.Blake2.alloca_blake2b_32",
"Hacl.Hash.Blake2.init_blake2b_32",
"Hacl.Hash.Blake2.update_multi_blake2b_32",
"Hacl.Hash.Blake2.update_last_blake2b_32",
"Hacl.Hash.Blake2.finish_blake2b_32"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256
let compute_sha2_384 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_384, ()|) hash_384 alloca_384 init_384 update_multi_384
update_last_384 finish_384
let compute_sha2_512 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_512, ()|) hash_512 alloca_512 init_512 update_multi_512
update_last_512 finish_512
let compute_blake2s =
let open Hacl.Hash.Blake2 in
mk_compute (|Blake2S, Hacl.Impl.Blake2.Core.M32|) hash_blake2s_32 alloca_blake2s_32
init_blake2s_32 update_multi_blake2s_32 update_last_blake2s_32 finish_blake2s_32
let compute_blake2b = | false | true | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_blake2b: compute_st Blake2B | [] | EverCrypt.HMAC.compute_blake2b | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.HMAC.compute_st Spec.Hash.Definitions.Blake2B | {
"end_col": 93,
"end_line": 89,
"start_col": 2,
"start_line": 88
} |
Prims.Tot | val compute: a: supported_alg -> compute_st a | [
{
"abbrev": true,
"full_module": "EverCrypt.Hash.Incremental",
"short_module": "Useless"
},
{
"abbrev": false,
"full_module": "Hacl.HMAC",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Agile.HMAC",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverCrypt",
"short_module": null
},
{
"abbrev": 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 compute a mac key keylen data datalen =
match a with
| SHA1 -> compute_sha1 mac key keylen data datalen
| SHA2_256 -> compute_sha2_256 mac key keylen data datalen
| SHA2_384 -> compute_sha2_384 mac key keylen data datalen
| SHA2_512 -> compute_sha2_512 mac key keylen data datalen
| Blake2S -> compute_blake2s mac key keylen data datalen
| Blake2B -> compute_blake2b mac key keylen data datalen | val compute: a: supported_alg -> compute_st a
let compute a mac key keylen data datalen = | false | null | false | match a with
| SHA1 -> compute_sha1 mac key keylen data datalen
| SHA2_256 -> compute_sha2_256 mac key keylen data datalen
| SHA2_384 -> compute_sha2_384 mac key keylen data datalen
| SHA2_512 -> compute_sha2_512 mac key keylen data datalen
| Blake2S -> compute_blake2s mac key keylen data datalen
| Blake2B -> compute_blake2b mac key keylen data datalen | {
"checked_file": "EverCrypt.HMAC.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Streaming.SHA2.fst.checked",
"Hacl.Impl.Blake2.Core.fsti.checked",
"Hacl.HMAC.fsti.checked",
"Hacl.Hash.SHA2.fsti.checked",
"Hacl.Hash.SHA1.fsti.checked",
"Hacl.Hash.Blake2.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.List.Tot.fst.checked",
"EverCrypt.Hash.Incremental.fst.checked",
"EverCrypt.Hash.fsti.checked"
],
"interface_file": true,
"source_file": "EverCrypt.HMAC.fst"
} | [
"total"
] | [
"EverCrypt.HMAC.supported_alg",
"LowStar.Buffer.buffer",
"Lib.IntTypes.uint8",
"Prims.eq2",
"Prims.nat",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"Spec.Hash.Definitions.hash_length",
"Prims.l_and",
"Spec.Agile.HMAC.keysized",
"LowStar.Monotonic.Buffer.disjoint",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt32.v",
"Prims.op_LessThan",
"Prims.op_Addition",
"Spec.Hash.Definitions.block_length",
"Prims.pow2",
"EverCrypt.HMAC.compute_sha1",
"Prims.unit",
"EverCrypt.HMAC.compute_sha2_256",
"EverCrypt.HMAC.compute_sha2_384",
"EverCrypt.HMAC.compute_sha2_512",
"EverCrypt.HMAC.compute_blake2s",
"EverCrypt.HMAC.compute_blake2b"
] | [] | (* Agile HMAC *)
module EverCrypt.HMAC
open Hacl.HMAC
// EverCrypt.Hash.Incremental.hash_256 is marked as private, so it is
// inaccessible from here. Furthermore, the EverCrypt.Hash.Incremental module
// does not have an interface, meaning that we can't even friend it! Writing an
// interface for EverCrypt.Hash.Incremental is possible, but doesn't make much
// sense: instantiations of the functor offer, by construction, an abstract
// interface. Fortunately, we can use tactics to stealthily gain access to a
// private definition that F* normally won't let us access.
let super_hack () =
let open FStar.Tactics in
let hash_256 = [ "EverCrypt"; "Hash"; "Incremental"; "hash_256"] in
let hash_256 = FStar.Tactics.pack_fv hash_256 in
let hash_256 = pack (Tv_FVar hash_256) in
let fv = pack_fv (cur_module () `FStar.List.Tot.append` [ "hash_256" ]) in
let t: term = pack Tv_Unknown in
let se = pack_sigelt (Sg_Let false [ pack_lb ({ lb_fv = fv; lb_us = []; lb_typ = t; lb_def = hash_256 }) ]) in
[ se ]
%splice[hash_256] (super_hack ())
// Due to the hack above, the dependency arrow is invisible to the F*
// parser/lexer, so we add an explicit dependency edge to avoid build errors.
module Useless = EverCrypt.Hash.Incremental
/// Four monomorphized variants, for callers who already know which algorithm they want
(** @type: true
*)
val compute_sha1: compute_st SHA1
(** @type: true
*)
val compute_sha2_256: compute_st SHA2_256
(** @type: true
*)
val compute_sha2_384: compute_st SHA2_384
(** @type: true
*)
val compute_sha2_512: compute_st SHA2_512
(** @type: true
*)
val compute_blake2s: compute_st Blake2S
(** @type: true
*)
val compute_blake2b: compute_st Blake2B
let compute_sha1 =
let open Hacl.Hash.SHA1 in
mk_compute (|SHA1, ()|) legacy_hash legacy_alloca legacy_init legacy_update_multi
legacy_update_last legacy_finish
(* This implementation calls into EverCrypt.Hash, which multiplexes
between Hacl and Vale implementations of SHA2_256 functions depending on
the static configuration and CPUID *)
let compute_sha2_256 =
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_256, ()|) hash_256 alloca_256 init_256
EverCrypt.Hash.update_multi_256
update_last_256 finish_256
let compute_sha2_384 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_384, ()|) hash_384 alloca_384 init_384 update_multi_384
update_last_384 finish_384
let compute_sha2_512 =
let open Hacl.Streaming.SHA2 in
let open Hacl.Hash.SHA2 in
mk_compute (|SHA2_512, ()|) hash_512 alloca_512 init_512 update_multi_512
update_last_512 finish_512
let compute_blake2s =
let open Hacl.Hash.Blake2 in
mk_compute (|Blake2S, Hacl.Impl.Blake2.Core.M32|) hash_blake2s_32 alloca_blake2s_32
init_blake2s_32 update_multi_blake2s_32 update_last_blake2s_32 finish_blake2s_32
let compute_blake2b =
let open Hacl.Hash.Blake2 in
mk_compute (|Blake2B, Hacl.Impl.Blake2.Core.M32|) hash_blake2b_32 alloca_blake2b_32
init_blake2b_32 update_multi_blake2b_32 update_last_blake2b_32 finish_blake2b_32 | false | false | EverCrypt.HMAC.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": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute: a: supported_alg -> compute_st a | [] | EverCrypt.HMAC.compute | {
"file_name": "providers/evercrypt/fst/EverCrypt.HMAC.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: EverCrypt.HMAC.supported_alg -> Hacl.HMAC.compute_st a | {
"end_col": 58,
"end_line": 98,
"start_col": 2,
"start_line": 92
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 trigger_create_heaplet (h:heaplet_id) = True | let trigger_create_heaplet (h: heaplet_id) = | false | null | false | True | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Memory.heaplet_id",
"Prims.l_True",
"Prims.logical"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l | false | true | Vale.PPC64LE.InsMem.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 trigger_create_heaplet : h: Vale.PPC64LE.Memory.heaplet_id -> Prims.logical | [] | Vale.PPC64LE.InsMem.trigger_create_heaplet | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: Vale.PPC64LE.Memory.heaplet_id -> Prims.logical | {
"end_col": 48,
"end_line": 33,
"start_col": 44,
"start_line": 33
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i | let heaplet_id_is_some (h: vale_heap) (i: heaplet_id) = | false | null | false | get_heaplet_id h == Some i | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.InsBasic.vale_heap",
"Vale.PPC64LE.Memory.heaplet_id",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"Vale.PPC64LE.Memory.get_heaplet_id",
"FStar.Pervasives.Native.Some",
"Prims.logical"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None | false | true | Vale.PPC64LE.InsMem.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 heaplet_id_is_some : h: Vale.PPC64LE.InsBasic.vale_heap -> i: Vale.PPC64LE.Memory.heaplet_id -> Prims.logical | [] | Vale.PPC64LE.InsMem.heaplet_id_is_some | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: Vale.PPC64LE.InsBasic.vale_heap -> i: Vale.PPC64LE.Memory.heaplet_id -> Prims.logical | {
"end_col": 28,
"end_line": 23,
"start_col": 2,
"start_line": 23
} |
|
Prims.Tot | val norm_list (p: prop) : prop | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p | val norm_list (p: prop) : prop
let norm_list (p: prop) : prop = | false | null | false | norm [zeta; iota; delta_only [`%list_to_seq_post]] p | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Prims.prop",
"FStar.Pervasives.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.zeta",
"FStar.Pervasives.iota",
"FStar.Pervasives.delta_only",
"Prims.string",
"Prims.Nil"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i | false | true | Vale.PPC64LE.InsMem.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 norm_list (p: prop) : prop | [] | Vale.PPC64LE.InsMem.norm_list | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | p: Prims.prop -> Prims.prop | {
"end_col": 54,
"end_line": 26,
"start_col": 2,
"start_line": 26
} |
Prims.Tot | val declare_buffer128 (b: buffer TUInt128) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut | val declare_buffer128 (b: buffer TUInt128) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info
let declare_buffer128 (b: buffer TUInt128) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info = | false | null | false | Mkbuffer_info TUInt128 b hid t mut | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.Arch.HeapTypes_s.TUInt128",
"Vale.PPC64LE.Memory.heaplet_id",
"Vale.Arch.HeapTypes_s.taint",
"Vale.Arch.HeapImpl.mutability",
"Vale.Arch.HeapImpl.Mkbuffer_info",
"Vale.Arch.HeapImpl.buffer_info"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr] | false | true | Vale.PPC64LE.InsMem.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 declare_buffer128 (b: buffer TUInt128) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info | [] | Vale.PPC64LE.InsMem.declare_buffer128 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
b: Vale.PPC64LE.Memory.buffer Vale.Arch.HeapTypes_s.TUInt128 ->
hid: Vale.PPC64LE.Memory.heaplet_id ->
t: Vale.Arch.HeapTypes_s.taint ->
mut: Vale.Arch.HeapImpl.mutability
-> Vale.Arch.HeapImpl.buffer_info | {
"end_col": 36,
"end_line": 41,
"start_col": 2,
"start_line": 41
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None | let heaplet_id_is_none (h: vale_heap) = | false | null | false | get_heaplet_id h == None | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.InsBasic.vale_heap",
"Prims.eq2",
"FStar.Pervasives.Native.option",
"Vale.PPC64LE.Memory.heaplet_id",
"Vale.PPC64LE.Memory.get_heaplet_id",
"FStar.Pervasives.Native.None",
"Prims.logical"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h | false | true | Vale.PPC64LE.InsMem.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 heaplet_id_is_none : h: Vale.PPC64LE.InsBasic.vale_heap -> Prims.logical | [] | Vale.PPC64LE.InsMem.heaplet_id_is_none | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | h: Vale.PPC64LE.InsBasic.vale_heap -> Prims.logical | {
"end_col": 26,
"end_line": 20,
"start_col": 2,
"start_line": 20
} |
|
Prims.Tot | val declare_buffer64 (b: buffer TUInt64) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut | val declare_buffer64 (b: buffer TUInt64) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info
let declare_buffer64 (b: buffer TUInt64) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info = | false | null | false | Mkbuffer_info TUInt64 b hid t mut | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.Arch.HeapTypes_s.TUInt64",
"Vale.PPC64LE.Memory.heaplet_id",
"Vale.Arch.HeapTypes_s.taint",
"Vale.Arch.HeapImpl.mutability",
"Vale.Arch.HeapImpl.Mkbuffer_info",
"Vale.Arch.HeapImpl.buffer_info"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr] | false | true | Vale.PPC64LE.InsMem.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 declare_buffer64 (b: buffer TUInt64) (hid: heaplet_id) (t: taint) (mut: mutability)
: buffer_info | [] | Vale.PPC64LE.InsMem.declare_buffer64 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
b: Vale.PPC64LE.Memory.buffer Vale.Arch.HeapTypes_s.TUInt64 ->
hid: Vale.PPC64LE.Memory.heaplet_id ->
t: Vale.Arch.HeapTypes_s.taint ->
mut: Vale.Arch.HeapImpl.mutability
-> Vale.Arch.HeapImpl.buffer_info | {
"end_col": 35,
"end_line": 37,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val norm_loc (l: loc) : loc | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l | val norm_loc (l: loc) : loc
let norm_loc (l: loc) : loc = | false | null | false | norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Memory.loc",
"FStar.Pervasives.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.zeta",
"FStar.Pervasives.iota",
"FStar.Pervasives.delta_only",
"Prims.string",
"Prims.Nil",
"FStar.Pervasives.delta_attr"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = () | false | true | Vale.PPC64LE.InsMem.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 norm_loc (l: loc) : loc | [] | Vale.PPC64LE.InsMem.norm_loc | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | l: Vale.PPC64LE.Memory.loc -> Vale.PPC64LE.Memory.loc | {
"end_col": 87,
"end_line": 31,
"start_col": 2,
"start_line": 31
} |
Prims.Tot | val va_wp_DestroyHeaplets (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (()))) | val va_wp_DestroyHeaplets (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_DestroyHeaplets (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner) /\
(forall (va_x_memLayout: vale_heap_layout).
let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0
)
.vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\
(va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\
(forall (h: heaplet_id). {:pattern (trigger_create_heaplet h)}
trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout va_s0
)
.vl_inner))
((va_get_mem_layout va_sM).vl_taint)
(va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM)
h) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Vale.PPC64LE.Memory.layout_heaplets_initialized",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_inner",
"Vale.PPC64LE.Decls.va_get_mem_layout",
"Prims.l_Forall",
"Vale.Arch.HeapImpl.vale_heap_layout",
"Prims.l_imp",
"Vale.PPC64LE.Decls.modifies_mem",
"Vale.PPC64LE.Memory.layout_modifies_loc",
"Vale.PPC64LE.Memory.layout_old_heap",
"Vale.PPC64LE.Decls.va_get_mem",
"Prims.eq2",
"Vale.Arch.HeapTypes_s.memTaint_t",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_taint",
"Vale.PPC64LE.InsMem.heaplet_id_is_none",
"Vale.PPC64LE.Memory.heaplet_id",
"Vale.PPC64LE.InsMem.trigger_create_heaplet",
"Vale.PPC64LE.Memory.heaps_match",
"Vale.PPC64LE.Memory.layout_buffers",
"Vale.PPC64LE.Decls.va_get_mem_heaplet",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_mem_layout"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr] | false | true | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_DestroyHeaplets (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.PPC64LE.InsMem.va_wp_DestroyHeaplets | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 76,
"end_line": 147,
"start_col": 2,
"start_line": 137
} |
Prims.Tot | val va_wp_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_dst:va_value_reg_opr) . let va_sM = va_upd_operand_reg_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index
(va_eval_heaplet va_sM h) ==> va_k va_sM (()))) | val va_wp_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0
let va_wp_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 = | false | null | false | (va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b index /\
Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64
b
(va_get_mem_layout va_s0)
(va_eval_heaplet va_s0 h)
false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b
(va_eval_heaplet va_s0 h)
((va_get_mem_layout va_s0).vl_taint)
t /\
va_eval_reg_opr va_s0 base + offset ==
Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) +
8
`op_Multiply`
index /\
(forall (va_x_dst: va_value_reg_opr).
let va_sM = va_upd_operand_reg_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\
va_eval_reg_opr va_sM dst ==
Vale.PPC64LE.Decls.buffer64_read b index (va_eval_heaplet va_sM h) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_heaplet",
"Vale.PPC64LE.Decls.va_operand_reg_opr",
"Prims.int",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.buffer64",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Vale.PPC64LE.Decls.va_is_src_heaplet",
"Vale.PPC64LE.Decls.va_is_dst_reg_opr",
"Vale.PPC64LE.Decls.va_is_src_reg_opr",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Vale.PPC64LE.Machine_s.valid_maddr_offset64",
"Vale.PPC64LE.Decls.valid_src_addr",
"Vale.PPC64LE.Memory.vuint64",
"Vale.PPC64LE.Decls.va_eval_heaplet",
"Vale.PPC64LE.Memory.valid_layout_buffer",
"Vale.PPC64LE.Decls.va_get_mem_layout",
"Vale.PPC64LE.Memory.valid_taint_buf64",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_taint",
"Prims.eq2",
"Prims.op_Addition",
"Vale.PPC64LE.Decls.va_eval_reg_opr",
"Vale.PPC64LE.Memory.buffer_addr",
"Prims.op_Multiply",
"Prims.l_Forall",
"Vale.PPC64LE.Decls.va_value_reg_opr",
"Prims.l_imp",
"Vale.PPC64LE.Machine_s.nat64",
"Vale.PPC64LE.Decls.buffer64_read",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_operand_reg_opr"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (())))
val va_wpProof_DestroyHeaplets : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_DestroyHeaplets va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_DestroyHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) =
(va_QProc (va_code_DestroyHeaplets ()) ([va_Mod_mem_layout]) va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets)
//--
//-- MemLoad64
val va_code_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemLoad64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
dst:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemLoad64 h dst base offset t) va_s0 /\
va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index (va_eval_heaplet va_sM h)
/\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_reg_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit -> | false | true | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [] | Vale.PPC64LE.InsMem.va_wp_MemLoad64 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: Vale.PPC64LE.Decls.va_operand_heaplet ->
dst: Vale.PPC64LE.Decls.va_operand_reg_opr ->
base: Vale.PPC64LE.Decls.va_operand_reg_opr ->
offset: Prims.int ->
t: Vale.Arch.HeapTypes_s.taint ->
b: Vale.PPC64LE.Memory.buffer64 ->
index: Prims.int ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 51,
"end_line": 197,
"start_col": 2,
"start_line": 187
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable)) | let create_post (layout: vale_heap_layout) (bs: Seq.seq buffer_info) = | false | null | false | forall (i: nat). {:pattern Seq.index bs i}
i < Seq.length bs ==>
(let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\ valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable)) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.Arch.HeapImpl.vale_heap_layout",
"FStar.Seq.Base.seq",
"Vale.Arch.HeapImpl.buffer_info",
"Prims.l_Forall",
"Prims.nat",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.Arch.HeapImpl.buffer",
"Vale.Arch.HeapImpl.heaplet_id",
"Vale.Arch.HeapTypes_s.taint",
"Vale.Arch.HeapImpl.mutability",
"Prims.l_and",
"Vale.PPC64LE.InsMem.trigger_create_heaplet",
"Vale.PPC64LE.Memory.valid_layout_buffer_id",
"FStar.Pervasives.Native.Some",
"Vale.PPC64LE.Memory.heaplet_id",
"Prims.op_Equality",
"Vale.Arch.HeapImpl.Mutable",
"Prims.logical",
"FStar.Seq.Base.index"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut | false | true | Vale.PPC64LE.InsMem.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 create_post : layout: Vale.Arch.HeapImpl.vale_heap_layout -> bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info
-> Prims.logical | [] | Vale.PPC64LE.InsMem.create_post | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | layout: Vale.Arch.HeapImpl.vale_heap_layout -> bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info
-> Prims.logical | {
"end_col": 65,
"end_line": 48,
"start_col": 2,
"start_line": 44
} |
|
Prims.Ghost | val buffer64_write (b: buffer64) (i: int) (v: nat64) (h: vale_heap)
: Ghost vale_heap (requires buffer_readable h b /\ buffer_writeable b) (ensures fun _ -> True) | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": 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 buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h | val buffer64_write (b: buffer64) (i: int) (v: nat64) (h: vale_heap)
: Ghost vale_heap (requires buffer_readable h b /\ buffer_writeable b) (ensures fun _ -> True)
let buffer64_write (b: buffer64) (i: int) (v: nat64) (h: vale_heap)
: Ghost vale_heap (requires buffer_readable h b /\ buffer_writeable b) (ensures fun _ -> True) = | false | null | false | buffer_write b i v h | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [] | [
"Vale.PPC64LE.Memory.buffer64",
"Prims.int",
"Vale.PPC64LE.Memory.nat64",
"Vale.PPC64LE.InsBasic.vale_heap",
"Vale.PPC64LE.Memory.buffer_write",
"Vale.PPC64LE.Memory.vuint64",
"Prims.l_and",
"Vale.PPC64LE.Memory.buffer_readable",
"Vale.PPC64LE.Memory.buffer_writeable",
"Prims.l_True"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True) | false | false | Vale.PPC64LE.InsMem.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 buffer64_write (b: buffer64) (i: int) (v: nat64) (h: vale_heap)
: Ghost vale_heap (requires buffer_readable h b /\ buffer_writeable b) (ensures fun _ -> True) | [] | Vale.PPC64LE.InsMem.buffer64_write | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
b: Vale.PPC64LE.Memory.buffer64 ->
i: Prims.int ->
v: Vale.PPC64LE.Memory.nat64 ->
h: Vale.PPC64LE.InsBasic.vale_heap
-> Prims.Ghost Vale.PPC64LE.InsBasic.vale_heap | {
"end_col": 22,
"end_line": 17,
"start_col": 2,
"start_line": 17
} |
Prims.Tot | val va_quick_CreateHeaplets (buffers: (list buffer_info))
: (va_quickCode unit (va_code_CreateHeaplets ())) | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers)) | val va_quick_CreateHeaplets (buffers: (list buffer_info))
: (va_quickCode unit (va_code_CreateHeaplets ()))
let va_quick_CreateHeaplets (buffers: (list buffer_info))
: (va_quickCode unit (va_code_CreateHeaplets ())) = | false | null | false | (va_QProc (va_code_CreateHeaplets ())
([va_Mod_mem_layout])
(va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers)) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.Arch.HeapImpl.buffer_info",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.PPC64LE.InsMem.va_code_CreateHeaplets",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_mem_layout",
"Prims.Nil",
"Vale.PPC64LE.InsMem.va_wp_CreateHeaplets",
"Vale.PPC64LE.InsMem.va_wpProof_CreateHeaplets",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit | false | false | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_CreateHeaplets (buffers: (list buffer_info))
: (va_quickCode unit (va_code_CreateHeaplets ())) | [] | Vale.PPC64LE.InsMem.va_quick_CreateHeaplets | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | buffers: Prims.list Vale.Arch.HeapImpl.buffer_info
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.PPC64LE.InsMem.va_code_CreateHeaplets ()) | {
"end_col": 40,
"end_line": 113,
"start_col": 2,
"start_line": 112
} |
Prims.Tot | val va_quick_DestroyHeaplets: Prims.unit -> (va_quickCode unit (va_code_DestroyHeaplets ())) | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) =
(va_QProc (va_code_DestroyHeaplets ()) ([va_Mod_mem_layout]) va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets) | val va_quick_DestroyHeaplets: Prims.unit -> (va_quickCode unit (va_code_DestroyHeaplets ()))
let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) = | false | null | false | (va_QProc (va_code_DestroyHeaplets ())
([va_Mod_mem_layout])
va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Prims.unit",
"Vale.PPC64LE.QuickCode.va_QProc",
"Vale.PPC64LE.InsMem.va_code_DestroyHeaplets",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_mem_layout",
"Prims.Nil",
"Vale.PPC64LE.InsMem.va_wp_DestroyHeaplets",
"Vale.PPC64LE.InsMem.va_wpProof_DestroyHeaplets",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (())))
val va_wpProof_DestroyHeaplets : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_DestroyHeaplets va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_DestroyHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_DestroyHeaplets: Prims.unit -> (va_quickCode unit (va_code_DestroyHeaplets ())) | [] | Vale.PPC64LE.InsMem.va_quick_DestroyHeaplets | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit (Vale.PPC64LE.InsMem.va_code_DestroyHeaplets ()) | {
"end_col": 31,
"end_line": 157,
"start_col": 2,
"start_line": 156
} |
Prims.Tot | val va_wp_CreateHeaplets
(buffers: (list buffer_info))
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (()))) | val va_wp_CreateHeaplets
(buffers: (list buffer_info))
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0
let va_wp_CreateHeaplets
(buffers: (list buffer_info))
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 = | false | null | false | (va_get_ok va_s0 /\
(let bs:(FStar.Seq.Base.seq buffer_info) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\
(norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\
(forall (va_x_memLayout: vale_heap_layout).
let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\
(let bs:(FStar.Seq.Base.seq buffer_info) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) ==
norm_loc (Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\
Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\
Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout va_sM).vl_inner) == bs /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_sM).vl_inner) /\
(va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
create_post (va_get_mem_layout va_sM) bs /\ heaplet_id_is_none (va_get_mem va_sM) /\
(forall (h: heaplet_id). {:pattern (trigger_create_heaplet h)}
trigger_create_heaplet h ==>
heaplet_id_is_some (Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\
Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint)
(va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM)
h) /\
(forall (i: nat). {:pattern (Seq.index bs i)}
i < FStar.Seq.Base.length #buffer_info bs ==>
Vale.PPC64LE.Memory.buffer_info_has_id bs
i
((FStar.Seq.Base.index #Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Prims.list",
"Vale.Arch.HeapImpl.buffer_info",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Vale.PPC64LE.Memory.is_initial_heap",
"Vale.PPC64LE.Decls.va_get_mem_layout",
"Vale.PPC64LE.Decls.va_get_mem",
"Prims.l_imp",
"Vale.PPC64LE.InsMem.norm_list",
"Vale.Lib.Seqs.list_to_seq_post",
"Vale.PPC64LE.Memory.init_heaplets_req",
"FStar.Seq.Base.seq",
"Vale.Lib.Seqs.list_to_seq",
"Prims.l_Forall",
"Vale.Arch.HeapImpl.vale_heap_layout",
"Prims.eq2",
"Vale.PPC64LE.Memory.loc",
"Vale.PPC64LE.Memory.layout_modifies_loc",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_inner",
"Vale.PPC64LE.InsMem.norm_loc",
"Vale.PPC64LE.Memory.loc_mutable_buffers",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.Memory.layout_old_heap",
"Vale.PPC64LE.Memory.layout_buffers",
"Vale.PPC64LE.Memory.layout_heaplets_initialized",
"Vale.Arch.HeapTypes_s.memTaint_t",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_taint",
"Vale.PPC64LE.InsMem.create_post",
"Vale.PPC64LE.InsMem.heaplet_id_is_none",
"Vale.PPC64LE.Memory.heaplet_id",
"Vale.PPC64LE.InsMem.trigger_create_heaplet",
"Vale.PPC64LE.InsMem.heaplet_id_is_some",
"Vale.PPC64LE.Decls.va_get_mem_heaplet",
"Vale.PPC64LE.Memory.heaps_match",
"Prims.nat",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"Vale.PPC64LE.Memory.buffer_info_has_id",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_heaplet",
"FStar.Seq.Base.index",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_mem_layout"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit -> | false | true | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_CreateHeaplets
(buffers: (list buffer_info))
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [] | Vale.PPC64LE.InsMem.va_wp_CreateHeaplets | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
buffers: Prims.list Vale.Arch.HeapImpl.buffer_info ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 77,
"end_line": 101,
"start_col": 2,
"start_line": 82
} |
Prims.Tot | val va_quick_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemLoad64 h dst base offset t)) | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemLoad64 h dst
base offset t)) =
(va_QProc (va_code_MemLoad64 h dst base offset t) ([va_mod_reg_opr dst]) (va_wp_MemLoad64 h dst
base offset t b index) (va_wpProof_MemLoad64 h dst base offset t b index)) | val va_quick_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemLoad64 h dst base offset t))
let va_quick_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemLoad64 h dst base offset t)) = | false | null | false | (va_QProc (va_code_MemLoad64 h dst base offset t)
([va_mod_reg_opr dst])
(va_wp_MemLoad64 h dst base offset t b index)
(va_wpProof_MemLoad64 h dst base offset t b index)) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_heaplet",
"Vale.PPC64LE.Decls.va_operand_reg_opr",
"Prims.int",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.buffer64",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.PPC64LE.InsMem.va_code_MemLoad64",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_mod_reg_opr",
"Prims.Nil",
"Vale.PPC64LE.InsMem.va_wp_MemLoad64",
"Vale.PPC64LE.InsMem.va_wpProof_MemLoad64",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (())))
val va_wpProof_DestroyHeaplets : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_DestroyHeaplets va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_DestroyHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) =
(va_QProc (va_code_DestroyHeaplets ()) ([va_Mod_mem_layout]) va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets)
//--
//-- MemLoad64
val va_code_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemLoad64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
dst:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemLoad64 h dst base offset t) va_s0 /\
va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index (va_eval_heaplet va_sM h)
/\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_reg_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_dst:va_value_reg_opr) . let va_sM = va_upd_operand_reg_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index
(va_eval_heaplet va_sM h) ==> va_k va_sM (())))
val va_wpProof_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 -> index:int -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_MemLoad64 h dst base offset t b index va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_MemLoad64 h dst base offset t)
([va_mod_reg_opr dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemLoad64 h dst | false | false | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_MemLoad64
(h: va_operand_heaplet)
(dst base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemLoad64 h dst base offset t)) | [] | Vale.PPC64LE.InsMem.va_quick_MemLoad64 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: Vale.PPC64LE.Decls.va_operand_heaplet ->
dst: Vale.PPC64LE.Decls.va_operand_reg_opr ->
base: Vale.PPC64LE.Decls.va_operand_reg_opr ->
offset: Prims.int ->
t: Vale.Arch.HeapTypes_s.taint ->
b: Vale.PPC64LE.Memory.buffer64 ->
index: Prims.int
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.PPC64LE.InsMem.va_code_MemLoad64 h dst base offset t) | {
"end_col": 78,
"end_line": 211,
"start_col": 2,
"start_line": 210
} |
Prims.Tot | val va_quick_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemStore64 h src base offset t)) | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_MemStore64 (h:va_operand_heaplet) (src:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemStore64 h src
base offset t)) =
(va_QProc (va_code_MemStore64 h src base offset t) ([va_Mod_mem; va_mod_heaplet h])
(va_wp_MemStore64 h src base offset t b index) (va_wpProof_MemStore64 h src base offset t b
index)) | val va_quick_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemStore64 h src base offset t))
let va_quick_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemStore64 h src base offset t)) = | false | null | false | (va_QProc (va_code_MemStore64 h src base offset t)
([va_Mod_mem; va_mod_heaplet h])
(va_wp_MemStore64 h src base offset t b index)
(va_wpProof_MemStore64 h src base offset t b index)) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_heaplet",
"Vale.PPC64LE.Decls.va_operand_reg_opr",
"Prims.int",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.buffer64",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.PPC64LE.InsMem.va_code_MemStore64",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_mem",
"Vale.PPC64LE.QuickCode.va_mod_heaplet",
"Prims.Nil",
"Vale.PPC64LE.InsMem.va_wp_MemStore64",
"Vale.PPC64LE.InsMem.va_wpProof_MemStore64",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (())))
val va_wpProof_DestroyHeaplets : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_DestroyHeaplets va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_DestroyHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) =
(va_QProc (va_code_DestroyHeaplets ()) ([va_Mod_mem_layout]) va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets)
//--
//-- MemLoad64
val va_code_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemLoad64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
dst:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemLoad64 h dst base offset t) va_s0 /\
va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index (va_eval_heaplet va_sM h)
/\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_reg_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_dst:va_value_reg_opr) . let va_sM = va_upd_operand_reg_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index
(va_eval_heaplet va_sM h) ==> va_k va_sM (())))
val va_wpProof_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 -> index:int -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_MemLoad64 h dst base offset t b index va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_MemLoad64 h dst base offset t)
([va_mod_reg_opr dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemLoad64 h dst
base offset t)) =
(va_QProc (va_code_MemLoad64 h dst base offset t) ([va_mod_reg_opr dst]) (va_wp_MemLoad64 h dst
base offset t b index) (va_wpProof_MemLoad64 h dst base offset t b index))
//--
//-- MemStore64
val va_code_MemStore64 : h:va_operand_heaplet -> src:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemStore64 : h:va_operand_heaplet -> src:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemStore64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
src:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemStore64 h src base offset t) va_s0 /\
va_is_dst_heaplet h va_s0 /\ va_is_src_reg_opr src va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_dst_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) true /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_heaplet va_sM h == buffer64_write b index (va_eval_reg_opr va_s0 src) (va_eval_heaplet
va_s0 h) /\ va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM
(va_update_operand_heaplet h va_sM va_s0)))))
[@ va_qattr]
let va_wp_MemStore64 (h:va_operand_heaplet) (src:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_dst_heaplet h va_s0 /\ va_is_src_reg_opr src va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_dst_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) true /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_h:va_value_heaplet) (va_x_mem:vale_heap) . let va_sM = va_upd_mem va_x_mem
(va_upd_operand_heaplet h va_x_h va_s0) in va_get_ok va_sM /\ va_eval_heaplet va_sM h ==
buffer64_write b index (va_eval_reg_opr va_s0 src) (va_eval_heaplet va_s0 h) ==> va_k va_sM
(())))
val va_wpProof_MemStore64 : h:va_operand_heaplet -> src:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 -> index:int -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_MemStore64 h src base offset t b index va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_MemStore64 h src base offset t)
([va_Mod_mem; va_mod_heaplet h]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_MemStore64 (h:va_operand_heaplet) (src:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemStore64 h src | false | false | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
: (va_quickCode unit (va_code_MemStore64 h src base offset t)) | [] | Vale.PPC64LE.InsMem.va_quick_MemStore64 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: Vale.PPC64LE.Decls.va_operand_heaplet ->
src: Vale.PPC64LE.Decls.va_operand_reg_opr ->
base: Vale.PPC64LE.Decls.va_operand_reg_opr ->
offset: Prims.int ->
t: Vale.Arch.HeapTypes_s.taint ->
b: Vale.PPC64LE.Memory.buffer64 ->
index: Prims.int
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.PPC64LE.InsMem.va_code_MemStore64 h src base offset t) | {
"end_col": 11,
"end_line": 268,
"start_col": 2,
"start_line": 266
} |
Prims.Tot | val va_wp_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_MemStore64 (h:va_operand_heaplet) (src:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_dst_heaplet h va_s0 /\ va_is_src_reg_opr src va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_dst_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) true /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_h:va_value_heaplet) (va_x_mem:vale_heap) . let va_sM = va_upd_mem va_x_mem
(va_upd_operand_heaplet h va_x_h va_s0) in va_get_ok va_sM /\ va_eval_heaplet va_sM h ==
buffer64_write b index (va_eval_reg_opr va_s0 src) (va_eval_heaplet va_s0 h) ==> va_k va_sM
(()))) | val va_wp_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0
let va_wp_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 = | false | null | false | (va_is_dst_heaplet h va_s0 /\ va_is_src_reg_opr src va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_dst_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b index /\
Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64
b
(va_get_mem_layout va_s0)
(va_eval_heaplet va_s0 h)
true /\
Vale.PPC64LE.Memory.valid_taint_buf64 b
(va_eval_heaplet va_s0 h)
((va_get_mem_layout va_s0).vl_taint)
t /\
va_eval_reg_opr va_s0 base + offset ==
Vale.PPC64LE.Memory.buffer_addr #Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) +
8
`op_Multiply`
index /\
(forall (va_x_h: va_value_heaplet) (va_x_mem: vale_heap).
let va_sM = va_upd_mem va_x_mem (va_upd_operand_heaplet h va_x_h va_s0) in
va_get_ok va_sM /\
va_eval_heaplet va_sM h ==
buffer64_write b index (va_eval_reg_opr va_s0 src) (va_eval_heaplet va_s0 h) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.PPC64LE.InsMem.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Memory.fsti.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Lib.Seqs.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.InsMem.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_heaplet",
"Vale.PPC64LE.Decls.va_operand_reg_opr",
"Prims.int",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.buffer64",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Vale.PPC64LE.Decls.va_is_dst_heaplet",
"Vale.PPC64LE.Decls.va_is_src_reg_opr",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Vale.PPC64LE.Machine_s.valid_maddr_offset64",
"Vale.PPC64LE.Decls.valid_dst_addr",
"Vale.PPC64LE.Memory.vuint64",
"Vale.PPC64LE.Decls.va_eval_heaplet",
"Vale.PPC64LE.Memory.valid_layout_buffer",
"Vale.PPC64LE.Decls.va_get_mem_layout",
"Vale.PPC64LE.Memory.valid_taint_buf64",
"Vale.Arch.HeapImpl.__proj__Mkvale_heap_layout__item__vl_taint",
"Prims.eq2",
"Prims.op_Addition",
"Vale.PPC64LE.Decls.va_eval_reg_opr",
"Vale.PPC64LE.Memory.buffer_addr",
"Prims.op_Multiply",
"Prims.l_Forall",
"Vale.PPC64LE.Decls.va_value_heaplet",
"Vale.PPC64LE.InsBasic.vale_heap",
"Prims.l_imp",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.InsMem.buffer64_write",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_mem",
"Vale.PPC64LE.Decls.va_upd_operand_heaplet"
] | [] | module Vale.PPC64LE.InsMem
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.QuickCode
open FStar.Seq
open Vale.Def.Types_s
open Vale.Arch.HeapTypes_s
open Vale.Arch.HeapImpl
open Vale.PPC64LE.Memory
open Vale.PPC64LE.InsBasic
open Vale.Lib.Seqs
let buffer64_write (b:buffer64) (i:int) (v:nat64) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures fun _ -> True)
=
buffer_write b i v h
let heaplet_id_is_none (h:vale_heap) =
get_heaplet_id h == None
let heaplet_id_is_some (h:vale_heap) (i:heaplet_id) =
get_heaplet_id h == Some i
unfold let norm_list (p:prop) : prop =
norm [zeta; iota; delta_only [`%list_to_seq_post]] p
irreducible let norm_loc_attr = ()
unfold let norm_loc (l:loc) : loc =
norm [zeta; iota; delta_only [`%loc_mutable_buffers]; delta_attr [`%norm_loc_attr]] l
let trigger_create_heaplet (h:heaplet_id) = True
[@norm_loc_attr]
unfold let declare_buffer64 (b:buffer TUInt64) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt64 b hid t mut
[@norm_loc_attr]
unfold let declare_buffer128 (b:buffer TUInt128) (hid:heaplet_id) (t:taint) (mut:mutability) : buffer_info =
Mkbuffer_info TUInt128 b hid t mut
let create_post (layout:vale_heap_layout) (bs:Seq.seq buffer_info) =
forall (i:nat).{:pattern Seq.index bs i} i < Seq.length bs ==> (
let Mkbuffer_info t b hid _ mut = Seq.index bs i in
trigger_create_heaplet hid /\
valid_layout_buffer_id t b layout (Some hid) false /\
valid_layout_buffer_id t b layout (Some hid) (mut = Mutable))
//-- CreateHeaplets
val va_code_CreateHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_CreateHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_CreateHeaplets : va_b0:va_code -> va_s0:va_state -> buffers:(list buffer_info)
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_CreateHeaplets ()) va_s0 /\ va_get_ok va_s0 /\ (let
(bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (norm_list
(Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs))))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq #buffer_info buffers in
norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_CreateHeaplets (buffers:(list buffer_info)) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_get_ok va_s0 /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in Vale.PPC64LE.Memory.is_initial_heap (va_get_mem_layout va_s0)
(va_get_mem va_s0) /\ (norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) ==>
Vale.PPC64LE.Memory.init_heaplets_req (va_get_mem va_s0) bs)) /\ (forall
(va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout va_x_memLayout va_s0 in
va_get_ok va_sM /\ (let (bs:(FStar.Seq.Base.seq buffer_info)) = Vale.Lib.Seqs.list_to_seq
#buffer_info buffers in norm_list (Vale.Lib.Seqs.list_to_seq_post #buffer_info buffers bs 0) /\
Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_sM).vl_inner) == norm_loc
(Vale.PPC64LE.Memory.loc_mutable_buffers buffers) /\ Vale.PPC64LE.Memory.layout_old_heap
((va_get_mem_layout va_sM).vl_inner) == va_get_mem va_s0 /\ Vale.PPC64LE.Memory.layout_buffers
((va_get_mem_layout va_sM).vl_inner) == bs /\ Vale.PPC64LE.Memory.layout_heaplets_initialized
((va_get_mem_layout va_sM).vl_inner) /\ (va_get_mem_layout va_sM).vl_taint ==
(va_get_mem_layout va_s0).vl_taint /\ create_post (va_get_mem_layout va_sM) bs /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==> heaplet_id_is_some
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h /\ Vale.PPC64LE.Memory.heaps_match bs
((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM) (Vale.PPC64LE.Decls.va_get_mem_heaplet
h va_sM) h) /\ (forall (i:nat) . {:pattern(Seq.index bs i)}i < FStar.Seq.Base.length
#buffer_info bs ==> Vale.PPC64LE.Memory.buffer_info_has_id bs i ((FStar.Seq.Base.index
#Vale.Arch.HeapImpl.buffer_info bs i).bi_heaplet))) ==> va_k va_sM (())))
val va_wpProof_CreateHeaplets : buffers:(list buffer_info) -> va_s0:va_state -> va_k:(va_state ->
unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_CreateHeaplets buffers va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_CreateHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_CreateHeaplets (buffers:(list buffer_info)) : (va_quickCode unit
(va_code_CreateHeaplets ())) =
(va_QProc (va_code_CreateHeaplets ()) ([va_Mod_mem_layout]) (va_wp_CreateHeaplets buffers)
(va_wpProof_CreateHeaplets buffers))
//--
//-- DestroyHeaplets
val va_code_DestroyHeaplets : va_dummy:unit -> Tot va_code
val va_codegen_success_DestroyHeaplets : va_dummy:unit -> Tot va_pbool
val va_lemma_DestroyHeaplets : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_DestroyHeaplets ()) va_s0 /\ va_get_ok va_s0 /\
Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout va_s0).vl_inner)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.PPC64LE.Decls.modifies_mem (Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout
va_s0).vl_inner)) (Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner))
(va_get_mem va_sM) /\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint
/\ heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) /\ va_state_eq va_sM (va_update_mem_layout
va_sM (va_update_ok va_sM va_s0))))
[@ va_qattr]
let va_wp_DestroyHeaplets (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.PPC64LE.Memory.layout_heaplets_initialized ((va_get_mem_layout
va_s0).vl_inner) /\ (forall (va_x_memLayout:vale_heap_layout) . let va_sM = va_upd_mem_layout
va_x_memLayout va_s0 in va_get_ok va_sM /\ Vale.PPC64LE.Decls.modifies_mem
(Vale.PPC64LE.Memory.layout_modifies_loc ((va_get_mem_layout va_s0).vl_inner))
(Vale.PPC64LE.Memory.layout_old_heap ((va_get_mem_layout va_s0).vl_inner)) (va_get_mem va_sM)
/\ (va_get_mem_layout va_sM).vl_taint == (va_get_mem_layout va_s0).vl_taint /\
heaplet_id_is_none (va_get_mem va_sM) /\ (forall (h:heaplet_id) .
{:pattern(trigger_create_heaplet h)}trigger_create_heaplet h ==>
Vale.PPC64LE.Memory.heaps_match (Vale.PPC64LE.Memory.layout_buffers ((va_get_mem_layout
va_s0).vl_inner)) ((va_get_mem_layout va_sM).vl_taint) (va_get_mem va_sM)
(Vale.PPC64LE.Decls.va_get_mem_heaplet h va_sM) h) ==> va_k va_sM (())))
val va_wpProof_DestroyHeaplets : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_DestroyHeaplets va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_DestroyHeaplets ())
([va_Mod_mem_layout]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_DestroyHeaplets () : (va_quickCode unit (va_code_DestroyHeaplets ())) =
(va_QProc (va_code_DestroyHeaplets ()) ([va_Mod_mem_layout]) va_wp_DestroyHeaplets
va_wpProof_DestroyHeaplets)
//--
//-- MemLoad64
val va_code_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemLoad64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
dst:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemLoad64 h dst base offset t) va_s0 /\
va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index (va_eval_heaplet va_sM h)
/\ va_state_eq va_sM (va_update_ok va_sM (va_update_operand_reg_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit ->
Type0)) : Type0 =
(va_is_src_heaplet h va_s0 /\ va_is_dst_reg_opr dst va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_src_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) false /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index /\ (forall
(va_x_dst:va_value_reg_opr) . let va_sM = va_upd_operand_reg_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_reg_opr va_sM dst == Vale.PPC64LE.Decls.buffer64_read b index
(va_eval_heaplet va_sM h) ==> va_k va_sM (())))
val va_wpProof_MemLoad64 : h:va_operand_heaplet -> dst:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 -> index:int -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_MemLoad64 h dst base offset t b index va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_MemLoad64 h dst base offset t)
([va_mod_reg_opr dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_MemLoad64 (h:va_operand_heaplet) (dst:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) : (va_quickCode unit (va_code_MemLoad64 h dst
base offset t)) =
(va_QProc (va_code_MemLoad64 h dst base offset t) ([va_mod_reg_opr dst]) (va_wp_MemLoad64 h dst
base offset t b index) (va_wpProof_MemLoad64 h dst base offset t b index))
//--
//-- MemStore64
val va_code_MemStore64 : h:va_operand_heaplet -> src:va_operand_reg_opr -> base:va_operand_reg_opr
-> offset:int -> t:taint -> Tot va_code
val va_codegen_success_MemStore64 : h:va_operand_heaplet -> src:va_operand_reg_opr ->
base:va_operand_reg_opr -> offset:int -> t:taint -> Tot va_pbool
val va_lemma_MemStore64 : va_b0:va_code -> va_s0:va_state -> h:va_operand_heaplet ->
src:va_operand_reg_opr -> base:va_operand_reg_opr -> offset:int -> t:taint -> b:buffer64 ->
index:int
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_MemStore64 h src base offset t) va_s0 /\
va_is_dst_heaplet h va_s0 /\ va_is_src_reg_opr src va_s0 /\ va_is_src_reg_opr base va_s0 /\
va_get_ok va_s0 /\ Vale.PPC64LE.Machine_s.valid_maddr_offset64 offset /\
Vale.PPC64LE.Decls.valid_dst_addr #Vale.PPC64LE.Memory.vuint64 (va_eval_heaplet va_s0 h) b
index /\ Vale.PPC64LE.Memory.valid_layout_buffer #Vale.PPC64LE.Memory.vuint64 b
(va_get_mem_layout va_s0) (va_eval_heaplet va_s0 h) true /\
Vale.PPC64LE.Memory.valid_taint_buf64 b (va_eval_heaplet va_s0 h) ((va_get_mem_layout
va_s0).vl_taint) t /\ va_eval_reg_opr va_s0 base + offset == Vale.PPC64LE.Memory.buffer_addr
#Vale.PPC64LE.Memory.vuint64 b (va_eval_heaplet va_s0 h) + 8 `op_Multiply` index))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_heaplet va_sM h == buffer64_write b index (va_eval_reg_opr va_s0 src) (va_eval_heaplet
va_s0 h) /\ va_state_eq va_sM (va_update_mem va_sM (va_update_ok va_sM
(va_update_operand_heaplet h va_sM va_s0)))))
[@ va_qattr]
let va_wp_MemStore64 (h:va_operand_heaplet) (src:va_operand_reg_opr) (base:va_operand_reg_opr)
(offset:int) (t:taint) (b:buffer64) (index:int) (va_s0:va_state) (va_k:(va_state -> unit -> | false | true | Vale.PPC64LE.InsMem.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_MemStore64
(h: va_operand_heaplet)
(src base: va_operand_reg_opr)
(offset: int)
(t: taint)
(b: buffer64)
(index: int)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [] | Vale.PPC64LE.InsMem.va_wp_MemStore64 | {
"file_name": "obj/Vale.PPC64LE.InsMem.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
h: Vale.PPC64LE.Decls.va_operand_heaplet ->
src: Vale.PPC64LE.Decls.va_operand_reg_opr ->
base: Vale.PPC64LE.Decls.va_operand_reg_opr ->
offset: Prims.int ->
t: Vale.Arch.HeapTypes_s.taint ->
b: Vale.PPC64LE.Memory.buffer64 ->
index: Prims.int ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 10,
"end_line": 253,
"start_col": 2,
"start_line": 242
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let state = Hacl.Streaming.MD.state_32 | let state = | false | null | false | Hacl.Streaming.MD.state_32 | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.MD.state_32"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5 | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val state : Type0 | [] | Hacl.Streaming.MD5.state | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 38,
"end_line": 33,
"start_col": 12,
"start_line": 33
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let state_t_md5 = state_t MD5 | let state_t_md5 = | false | null | false | state_t MD5 | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.MD.state_t",
"Spec.Hash.Definitions.MD5"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5 | false | true | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val state_t_md5 : Hacl.Streaming.Interface.stateful Prims.unit | [] | Hacl.Streaming.MD5.state_t_md5 | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Interface.stateful Prims.unit | {
"end_col": 29,
"end_line": 30,
"start_col": 18,
"start_line": 30
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let hacl_md5 = hacl_md MD5 | let hacl_md5 = | false | null | false | hacl_md MD5 | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.MD.hacl_md",
"Spec.Hash.Definitions.MD5"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental | false | true | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val hacl_md5 : Hacl.Streaming.Interface.block Prims.unit | [] | Hacl.Streaming.MD5.hacl_md5 | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Interface.block Prims.unit | {
"end_col": 26,
"end_line": 27,
"start_col": 15,
"start_line": 27
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit) | let legacy_create_in = | false | null | false | F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.create_in",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_create_in : Hacl.Streaming.Functor.create_in_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_create_in | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.create_in_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 81,
"end_line": 37,
"start_col": 23,
"start_line": 37
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit) | let legacy_alloca = | false | null | false | F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.alloca",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32 | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_alloca : Hacl.Streaming.Functor.alloca_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_alloca | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.alloca_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 75,
"end_line": 36,
"start_col": 20,
"start_line": 36
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_update = F.update hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | let legacy_update = | false | null | false | F.update hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.update",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"FStar.Ghost.hide",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_update : Hacl.Streaming.Functor.update_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_update | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.update_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 84,
"end_line": 41,
"start_col": 20,
"start_line": 41
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_copy = F.copy hacl_md5 () (state_t_md5.s ()) (G.erased unit) | let legacy_copy = | false | null | false | F.copy hacl_md5 () (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.copy",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"FStar.Ghost.hide",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
[@@ Comment "0 = success, 1 = max length exceeded" ]
let legacy_update = F.update hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
let legacy_finish = F.mk_finish hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_free = F.free hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_copy : Hacl.Streaming.Functor.copy_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_copy | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.copy_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 71,
"end_line": 45,
"start_col": 18,
"start_line": 45
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_finish = F.mk_finish hacl_md5 () (state_t_md5.s ()) (G.erased unit) | let legacy_finish = | false | null | false | F.mk_finish hacl_md5 () (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.mk_finish",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
[@@ Comment "0 = success, 1 = max length exceeded" ] | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_finish : Hacl.Streaming.Functor.finish_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_finish | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.finish_st Hacl.Streaming.MD5.hacl_md5
()
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 78,
"end_line": 42,
"start_col": 20,
"start_line": 42
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_free = F.free hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | let legacy_free = | false | null | false | F.free hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.free",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"FStar.Ghost.hide",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
[@@ Comment "0 = success, 1 = max length exceeded" ]
let legacy_update = F.update hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_free : Hacl.Streaming.Functor.free_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_free | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.free_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.reveal (FStar.Ghost.hide ()))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 80,
"end_line": 43,
"start_col": 18,
"start_line": 43
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | let legacy_init = | false | null | false | F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit) | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"Hacl.Streaming.Functor.init",
"Prims.unit",
"Hacl.Streaming.MD5.hacl_md5",
"FStar.Ghost.hide",
"Hacl.Streaming.Interface.__proj__Stateful__item__s",
"Hacl.Streaming.MD5.state_t_md5",
"FStar.Ghost.erased"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit) | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_init : Hacl.Streaming.Functor.init_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.hide (FStar.Ghost.reveal (FStar.Ghost.hide ())))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | [] | Hacl.Streaming.MD5.legacy_init | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Streaming.Functor.init_st Hacl.Streaming.MD5.hacl_md5
(FStar.Ghost.hide (FStar.Ghost.reveal (FStar.Ghost.hide ())))
(Stateful?.s Hacl.Streaming.MD5.state_t_md5 ())
(FStar.Ghost.erased Prims.unit) | {
"end_col": 80,
"end_line": 38,
"start_col": 18,
"start_line": 38
} |
|
Prims.Tot | val legacy_hash:Hacl.Hash.Definitions.hash_st MD5 | [
{
"abbrev": false,
"full_module": "Hacl.Streaming.MD",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming.Interface",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let legacy_hash: Hacl.Hash.Definitions.hash_st MD5 = fun input input_len dst -> Hacl.Hash.MD5.legacy_hash input input_len dst | val legacy_hash:Hacl.Hash.Definitions.hash_st MD5
let legacy_hash:Hacl.Hash.Definitions.hash_st MD5 = | false | null | false | fun input input_len dst -> Hacl.Hash.MD5.legacy_hash input input_len dst | {
"checked_file": "Hacl.Streaming.MD5.fst.checked",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Hacl.Streaming.MD.fst.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Hash.MD5.fsti.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.MD5.fst"
} | [
"total"
] | [
"LowStar.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"Hacl.Hash.Definitions.hash_t",
"Spec.Hash.Definitions.MD5",
"Hacl.Hash.MD5.legacy_hash",
"Prims.unit"
] | [] | module Hacl.Streaming.MD5
/// WARNING: this file is here for legacy purposes only. You SHOULD NOT use
/// it in new code.
open FStar.HyperStack.ST
/// A streaming version of MD-based hashes
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
module G = FStar.Ghost
module F = Hacl.Streaming.Functor
open Spec.Hash.Definitions
open Hacl.Streaming.Interface
open Hacl.Streaming.MD
/// Instantiations of the streaming functor for MD5
///
/// Some remarks:
///
/// - we don't bother with using the abstraction feature since we verified
/// clients like miTLS go through EverCrypt.Hash.Incremental
inline_for_extraction noextract
let hacl_md5 = hacl_md MD5
inline_for_extraction noextract
let state_t_md5 = state_t MD5
/// Type abbreviation - for pretty code generation
let state = Hacl.Streaming.MD.state_32
noextract
let legacy_alloca = F.alloca hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_create_in = F.create_in hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_init = F.init hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
[@@ Comment "0 = success, 1 = max length exceeded" ]
let legacy_update = F.update hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
let legacy_finish = F.mk_finish hacl_md5 () (state_t_md5.s ()) (G.erased unit)
let legacy_free = F.free hacl_md5 (G.hide ()) (state_t_md5.s ()) (G.erased unit)
let legacy_copy = F.copy hacl_md5 () (state_t_md5.s ()) (G.erased unit) | false | false | Hacl.Streaming.MD5.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val legacy_hash:Hacl.Hash.Definitions.hash_st MD5 | [] | Hacl.Streaming.MD5.legacy_hash | {
"file_name": "code/streaming/Hacl.Streaming.MD5.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Hash.Definitions.hash_st Spec.Hash.Definitions.MD5 | {
"end_col": 125,
"end_line": 47,
"start_col": 53,
"start_line": 47
} |
Prims.Tot | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len) | let ntuple (a: Type0) (len: flen) = | false | null | false | normalize_term (ntuple_ a len) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"FStar.Pervasives.normalize_term",
"Lib.NTuple.ntuple_"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1) | false | true | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ntuple : a: Type0 -> len: Lib.NTuple.flen -> Type0 | [] | Lib.NTuple.ntuple | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Type0 -> len: Lib.NTuple.flen -> Type0 | {
"end_col": 64,
"end_line": 19,
"start_col": 34,
"start_line": 19
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let op_Lens_Access #a #len = index #a #len | let op_Lens_Access #a #len = | false | null | false | index #a #len | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Lib.NTuple.index",
"Lib.NTuple.ntuple",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)] | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Lens_Access : s: Lib.NTuple.ntuple a len -> i: Prims.nat{i < len} -> a | [] | Lib.NTuple.op_Lens_Access | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | s: Lib.NTuple.ntuple a len -> i: Prims.nat{i < len} -> a | {
"end_col": 49,
"end_line": 157,
"start_col": 36,
"start_line": 157
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let flen = size_pos | let flen = | false | null | false | size_pos | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.IntTypes.size_pos"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples | false | true | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val flen : Type0 | [] | Lib.NTuple.flen | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 19,
"end_line": 11,
"start_col": 11,
"start_line": 11
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let op_Lens_Assignment #a #len = upd #a #len | let op_Lens_Assignment #a #len = | false | null | false | upd #a #len | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Lib.NTuple.upd",
"Lib.NTuple.ntuple",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)] | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val op_Lens_Assignment : s: Lib.NTuple.ntuple a len -> i: Prims.nat{i < len} -> x: a -> Lib.NTuple.ntuple a len | [] | Lib.NTuple.op_Lens_Assignment | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | s: Lib.NTuple.ntuple a len -> i: Prims.nat{i < len} -> x: a -> Lib.NTuple.ntuple a len | {
"end_col": 51,
"end_line": 158,
"start_col": 40,
"start_line": 158
} |
|
Prims.Tot | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1) | let rec ntuple_ (a: Type0) (len: flen) = | false | null | false | if len = 1 then a else a & ntuple_ a (len - 1) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"FStar.Pervasives.Native.tuple2",
"Lib.NTuple.ntuple_",
"Prims.op_Subtraction"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction | false | true | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ntuple_ : a: Type0 -> len: Lib.NTuple.flen -> Type0 | [
"recursion"
] | Lib.NTuple.ntuple_ | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Type0 -> len: Lib.NTuple.flen -> Type0 | {
"end_col": 28,
"end_line": 16,
"start_col": 2,
"start_line": 15
} |
|
Prims.Tot | val ntup1 (#a: _) (#l: flen{l = 1}) (t: a) : ntuple a l | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1 | val ntup1 (#a: _) (#l: flen{l = 1}) (t: a) : ntuple a l
let ntup1 #a (#l: flen{l = 1}) (t: a) : ntuple a l = | false | null | false | assert (ntuple a l == ntuple a 1);
t <: ntuple a 1 | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ntup1 (#a: _) (#l: flen{l = 1}) (t: a) : ntuple a l | [] | Lib.NTuple.ntup1 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: a -> Lib.NTuple.ntuple a l | {
"end_col": 17,
"end_line": 164,
"start_col": 2,
"start_line": 163
} |
Prims.Tot | val tup1 (#a: _) (#l: flen{l = 1}) (t: ntuple a l) : a | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let tup1 #a (#l:flen{l = 1}) (t:ntuple a l) : a =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1 | val tup1 (#a: _) (#l: flen{l = 1}) (t: ntuple a l) : a
let tup1 #a (#l: flen{l = 1}) (t: ntuple a l) : a = | false | null | false | assert (ntuple a l == ntuple a 1);
t <: ntuple a 1 | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction
let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val ntup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:a):
Lemma (let x0 = t in let t = ntup1 #a #l t in x0 == t.(|0|))
[SMTPat (ntup1 #a #l t)]
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val tup1 (#a: _) (#l: flen{l = 1}) (t: ntuple a l) : a | [] | Lib.NTuple.tup1 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: Lib.NTuple.ntuple a l -> a | {
"end_col": 17,
"end_line": 173,
"start_col": 2,
"start_line": 172
} |
Prims.Tot | val ntup4 (#a: _) (#l: flen{l = 4}) (t: a & (a & (a & a))) : ntuple a l | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ntup4 #a (#l:flen{l = 4}) (t:a & (a & (a & a))) : ntuple a l =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4) | val ntup4 (#a: _) (#l: flen{l = 4}) (t: a & (a & (a & a))) : ntuple a l
let ntup4 #a (#l: flen{l = 4}) (t: a & (a & (a & a))) : ntuple a l = | false | null | false | assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.tuple2",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction
let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val ntup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:a):
Lemma (let x0 = t in let t = ntup1 #a #l t in x0 == t.(|0|))
[SMTPat (ntup1 #a #l t)]
inline_for_extraction
let tup1 #a (#l:flen{l = 1}) (t:ntuple a l) : a =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val tup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:ntuple a l):
Lemma (let x0 = tup1 t in x0 == t.(|0|))
[SMTPat (tup1 #a #l t)]
#set-options "--fuel 4"
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 4,
"initial_ifuel": 0,
"max_fuel": 4,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ntup4 (#a: _) (#l: flen{l = 4}) (t: a & (a & (a & a))) : ntuple a l | [] | Lib.NTuple.ntup4 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: (a * (a * (a * a))) -> Lib.NTuple.ntuple a l | {
"end_col": 19,
"end_line": 184,
"start_col": 2,
"start_line": 183
} |
Prims.Tot | val ntup8 (#a: _) (#l: flen{l = 8}) (t: a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ntup8 #a (#l:flen{l = 8}) (t:a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l =
assert (ntuple a l == ntuple a 8);
(t <: ntuple a 8) | val ntup8 (#a: _) (#l: flen{l = 8}) (t: a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l
let ntup8 #a (#l: flen{l = 8}) (t: a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l = | false | null | false | assert (ntuple a l == ntuple a 8);
(t <: ntuple a 8) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.tuple2",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction
let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val ntup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:a):
Lemma (let x0 = t in let t = ntup1 #a #l t in x0 == t.(|0|))
[SMTPat (ntup1 #a #l t)]
inline_for_extraction
let tup1 #a (#l:flen{l = 1}) (t:ntuple a l) : a =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val tup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:ntuple a l):
Lemma (let x0 = tup1 t in x0 == t.(|0|))
[SMTPat (tup1 #a #l t)]
#set-options "--fuel 4"
inline_for_extraction
let ntup4 #a (#l:flen{l = 4}) (t:a & (a & (a & a))) : ntuple a l =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4)
val ntup4_lemma (#a:Type0) (#l:flen{l == 4}) (t:a & (a & (a & a))) :
Lemma
(let (x0,(x1,(x2,x3))) = t in
let t = ntup4 #a #l t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|))
[SMTPat (ntup4 #a #l t)]
inline_for_extraction
let tup4 #a (#l:flen{l = 4}) (t:ntuple a l) : (a & (a & (a & a))) =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4)
val tup4_lemma (#a:Type0) (#l:flen{l = 4}) (t:ntuple a l) :
Lemma
(let (x0,(x1,(x2,x3))) = tup4 t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|))
[SMTPat (tup4 t)]
#set-options "--fuel 8"
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 8,
"initial_ifuel": 0,
"max_fuel": 8,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ntup8 (#a: _) (#l: flen{l = 8}) (t: a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l | [] | Lib.NTuple.ntup8 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: (a * (a * (a * (a * (a * (a * (a * a))))))) -> Lib.NTuple.ntuple a l | {
"end_col": 19,
"end_line": 211,
"start_col": 2,
"start_line": 210
} |
Prims.Tot | val tup8 (#a: _) (#l: flen{l = 8}) (t: ntuple a l) : (a & (a & (a & (a & (a & (a & (a & a))))))) | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let tup8 #a (#l:flen{l = 8}) (t:ntuple a l) : (a & (a & (a & (a & (a & (a & (a & a))))))) =
assert (ntuple a l == ntuple a 8);
(t <: ntuple a 8) | val tup8 (#a: _) (#l: flen{l = 8}) (t: ntuple a l) : (a & (a & (a & (a & (a & (a & (a & a)))))))
let tup8 #a (#l: flen{l = 8}) (t: ntuple a l) : (a & (a & (a & (a & (a & (a & (a & a))))))) = | false | null | false | assert (ntuple a l == ntuple a 8);
(t <: ntuple a 8) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"FStar.Pervasives.Native.tuple2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction
let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val ntup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:a):
Lemma (let x0 = t in let t = ntup1 #a #l t in x0 == t.(|0|))
[SMTPat (ntup1 #a #l t)]
inline_for_extraction
let tup1 #a (#l:flen{l = 1}) (t:ntuple a l) : a =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val tup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:ntuple a l):
Lemma (let x0 = tup1 t in x0 == t.(|0|))
[SMTPat (tup1 #a #l t)]
#set-options "--fuel 4"
inline_for_extraction
let ntup4 #a (#l:flen{l = 4}) (t:a & (a & (a & a))) : ntuple a l =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4)
val ntup4_lemma (#a:Type0) (#l:flen{l == 4}) (t:a & (a & (a & a))) :
Lemma
(let (x0,(x1,(x2,x3))) = t in
let t = ntup4 #a #l t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|))
[SMTPat (ntup4 #a #l t)]
inline_for_extraction
let tup4 #a (#l:flen{l = 4}) (t:ntuple a l) : (a & (a & (a & a))) =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4)
val tup4_lemma (#a:Type0) (#l:flen{l = 4}) (t:ntuple a l) :
Lemma
(let (x0,(x1,(x2,x3))) = tup4 t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|))
[SMTPat (tup4 t)]
#set-options "--fuel 8"
inline_for_extraction
let ntup8 #a (#l:flen{l = 8}) (t:a & (a & (a & (a & (a & (a & (a & a))))))) : ntuple a l =
assert (ntuple a l == ntuple a 8);
(t <: ntuple a 8)
val ntup8_lemma (#a:Type0) (#l:flen{l == 8}) (t:a & (a & (a & (a & (a & (a & (a & a))))))) :
Lemma
(let (x0,(x1,(x2,(x3,(x4,(x5,(x6,x7))))))) = t in
let t = ntup8 #a #l t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|) /\
x4 == t.(|4|) /\ x5 == t.(|5|) /\
x6 == t.(|6|) /\ x7 == t.(|7|))
[SMTPat (ntup8 #a #l t)]
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 8,
"initial_ifuel": 0,
"max_fuel": 8,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val tup8 (#a: _) (#l: flen{l = 8}) (t: ntuple a l) : (a & (a & (a & (a & (a & (a & (a & a))))))) | [] | Lib.NTuple.tup8 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: Lib.NTuple.ntuple a l -> a * (a * (a * (a * (a * (a * (a * a)))))) | {
"end_col": 19,
"end_line": 226,
"start_col": 2,
"start_line": 225
} |
Prims.Tot | val tup4 (#a: _) (#l: flen{l = 4}) (t: ntuple a l) : (a & (a & (a & a))) | [
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let tup4 #a (#l:flen{l = 4}) (t:ntuple a l) : (a & (a & (a & a))) =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4) | val tup4 (#a: _) (#l: flen{l = 4}) (t: ntuple a l) : (a & (a & (a & a)))
let tup4 #a (#l: flen{l = 4}) (t: ntuple a l) : (a & (a & (a & a))) = | false | null | false | assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4) | {
"checked_file": "Lib.NTuple.fsti.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Lib.NTuple.fsti"
} | [
"total"
] | [
"Lib.NTuple.flen",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Lib.NTuple.ntuple",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"FStar.Pervasives.Native.tuple2"
] | [] | module Lib.NTuple
open FStar.Mul
open Lib.IntTypes
#set-options "--z3rlimit 15 --ifuel 0 --fuel 0"
/// Fixed and bounded length sequences, implemented using tuples
inline_for_extraction
let flen = size_pos
inline_for_extraction
let rec ntuple_ (a:Type0) (len:flen) =
if len = 1 then a
else a & ntuple_ a (len-1)
inline_for_extraction
let ntuple (a:Type0) (len:flen) = normalize_term (ntuple_ a len)
inline_for_extraction
val fst (#a:Type0) (#len:flen) (s:ntuple a len) : a
inline_for_extraction
val rest (#a:Type0) (#len:flen{len > 1}) (s:ntuple a len) : ntuple a (len - 1)
inline_for_extraction
val index (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) : a
val index_fst_lemma (#a:Type0) (#len:flen) (s:ntuple a len) :
Lemma (fst s == index s 0)
[SMTPat (fst s)]
inline_for_extraction
val createi (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) : ntuple a len
inline_for_extraction
val gcreatei (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) : GTot (ntuple a len)
val createi_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> a)) (i:nat{i < len}) :
Lemma (index (createi #a len f) i == f i)
[SMTPat (index (createi #a len f) i)]
val gcreatei_lemma (#a:Type0) (len:flen) (f:(i:nat{i < len} -> GTot a)) (i:nat{i < len}) :
Lemma (index (gcreatei #a len f) i == f i)
[SMTPat (index (gcreatei #a len f) i)]
inline_for_extraction
val to_lseq (#a:Type0) (#len:flen) (l:ntuple a len) : Lib.Sequence.lseq a len
val to_lseq_index (#a:Type0) (#len:flen) (l:ntuple a len) (i:nat{i < len}) :
Lemma (index l i == Lib.Sequence.index (to_lseq l) i)
inline_for_extraction
val from_lseq (#a:Type0) (#len:flen) (s:Lib.Sequence.lseq a len) : ntuple a len
inline_for_extraction
val create (#a:Type0) (len:flen) (init:a) : ntuple a len
val create_lemma (#a:Type0) (len:flen) (init:a) (i:nat{i < len}) :
Lemma (index (create #a len init) i == init)
[SMTPat (index (create #a len init) i)]
inline_for_extraction
val concat (#a:Type0) (#len0:flen) (#len1:flen{len0 + len1 <= max_size_t})
(s0:ntuple a len0) (s1:ntuple a len1) : ntuple a (len0 + len1)
val concat_lemma (#a:Type0) (#len0:flen) (#len1:flen) (s0:ntuple a len0) (s1:ntuple a len1) (i:nat):
Lemma
(requires (len0 + len1 <= max_size_t /\ i < len0 + len1))
(ensures ((i < len0 ==> index (concat s0 s1) i == index s0 i) /\
(i >= len0 ==> index (concat s0 s1) i == index s1 (i-len0))))
[SMTPat (index (concat #a #len0 #len1 s0 s1) i)]
inline_for_extraction
val equal (#a:Type) (#len:flen) (s1:ntuple a len) (s2:ntuple a len) : Type0
val eq_intro: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires forall i. {:pattern index s1 i; index s2 i} index s1 i == index s2 i)
(ensures equal s1 s2)
[SMTPat (equal s1 s2)]
val eq_elim: #a:Type -> #len:flen -> s1:ntuple a len -> s2:ntuple a len ->
Lemma
(requires equal s1 s2)
(ensures s1 == s2)
[SMTPat (equal s1 s2)]
(** Updating an element of a fixed-length Sequence *)
inline_for_extraction
val upd: #a:Type -> #len:flen -> s:ntuple a len -> i:nat{i < len} -> x:a -> ntuple a len
val upd_lemma (#a:Type0) (#len:flen) (s:ntuple a len) (i:nat{i < len}) (x:a) (j:nat{j < len}) :
Lemma (index (upd #a #len s i x) j == (if i = j then x else index s j))
[SMTPat (index (upd #a #len s i x) j)]
inline_for_extraction
val sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) : ntuple a n
val index_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (i:nat{i < n}) :
Lemma (index (sub #a #len s start n) i == index s (start + i))
[SMTPat (index (sub #a #len s start n) i)]
inline_for_extraction
val update_sub (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) : ntuple a len
val index_update_sub_lemma (#a:Type) (#len:flen) (s:ntuple a len) (start:nat) (n:flen{start + n <= len}) (x:ntuple a n) (i:nat{i < n}) :
Lemma
(index (update_sub #a #len s start n x) i == (if i >= start && i < start + n then index x (i - start) else index s i))
[SMTPat (index (update_sub #a #len s start n x) i)]
inline_for_extraction
val mapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) : ntuple b len
val index_mapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (mapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (mapi #a #b #len f s) i)]
inline_for_extraction
val gmapi (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) : GTot (ntuple b len)
val index_gmapi_lemma (#a:Type) (#b:Type) (#len:flen) (f:(i:nat{i < len} -> a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmapi #a #b #len f s) i == f i (index s i))
[SMTPat (index (gmapi #a #b #len f s) i)]
inline_for_extraction
val map (#a:Type) (#b:Type) (#len:flen) (f:a -> b) (s:ntuple a len) : ntuple b len
val index_map_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (map #a #b #len f s) i == f (index s i))
[SMTPat (index (map #a #b #len f s) i)]
inline_for_extraction
val gmap (#a:Type) (#b:Type) (#len:flen) (f:a -> GTot b) (s:ntuple a len) : GTot (ntuple b len)
val index_gmap_lemma (#a:Type) (#b:Type) (#len:flen) (f:(a -> GTot b)) (s:ntuple a len) (i:nat{i < len}) :
Lemma (index (gmap #a #b #len f s) i == f (index s i))
[SMTPat (index (gmap #a #b #len f s) i)]
inline_for_extraction
val map2i (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2i_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(i:nat{i < len} -> a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2i #a #b #c #len f s1 s2) i == f i (index s1 i) (index s2 i))
[SMTPat (index (map2i #a #b #c #len f s1 s2) i)]
inline_for_extraction
val map2 (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:(a -> b -> c)) (s1:ntuple a len) (s2:ntuple b len) : ntuple c len
val index_map2_lemma (#a:Type) (#b:Type) (#c:Type) (#len:flen) (f:a -> b -> c) (s1:ntuple a len) (s2:ntuple b len) (i:nat{i < len}) :
Lemma (index (map2 #a #b #c #len f s1 s2) i == f (index s1 i) (index s2 i))
[SMTPat (index (map2 #a #b #c #len f s1 s2) i)]
unfold let op_Lens_Access #a #len = index #a #len
unfold let op_Lens_Assignment #a #len = upd #a #len
(* The following conversions are tedious, but are needed to aid KaRaMeL in extracting ntuples correctly *)
inline_for_extraction
let ntup1 #a (#l:flen{l = 1}) (t:a) : ntuple a l =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val ntup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:a):
Lemma (let x0 = t in let t = ntup1 #a #l t in x0 == t.(|0|))
[SMTPat (ntup1 #a #l t)]
inline_for_extraction
let tup1 #a (#l:flen{l = 1}) (t:ntuple a l) : a =
assert (ntuple a l == ntuple a 1);
t <: ntuple a 1
val tup1_lemma (#a:Type0) (#l:flen{l == 1}) (t:ntuple a l):
Lemma (let x0 = tup1 t in x0 == t.(|0|))
[SMTPat (tup1 #a #l t)]
#set-options "--fuel 4"
inline_for_extraction
let ntup4 #a (#l:flen{l = 4}) (t:a & (a & (a & a))) : ntuple a l =
assert (ntuple a l == ntuple a 4);
(t <: ntuple a 4)
val ntup4_lemma (#a:Type0) (#l:flen{l == 4}) (t:a & (a & (a & a))) :
Lemma
(let (x0,(x1,(x2,x3))) = t in
let t = ntup4 #a #l t in
x0 == t.(|0|) /\ x1 == t.(|1|) /\
x2 == t.(|2|) /\ x3 == t.(|3|))
[SMTPat (ntup4 #a #l t)]
inline_for_extraction | false | false | Lib.NTuple.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 4,
"initial_ifuel": 0,
"max_fuel": 4,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 15,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val tup4 (#a: _) (#l: flen{l = 4}) (t: ntuple a l) : (a & (a & (a & a))) | [] | Lib.NTuple.tup4 | {
"file_name": "lib/Lib.NTuple.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | t: Lib.NTuple.ntuple a l -> a * (a * (a * a)) | {
"end_col": 19,
"end_line": 197,
"start_col": 2,
"start_line": 196
} |
FStar.Pervasives.Lemma | val pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len | val pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len) = | false | null | true | pad0_length_mod a base_len len | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"lemma"
] | [
"Spec.Hash.Definitions.hash_alg",
"Prims.b2t",
"Spec.Hash.Definitions.is_md",
"Prims.nat",
"Hacl.Hash.MD.pad0_length_mod",
"Prims.unit",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Spec.Hash.Definitions.block_length",
"Prims.squash",
"Prims.l_or",
"Prims.op_Addition",
"Spec.Hash.Definitions.pad_length",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0) | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len) | [] | Hacl.Hash.MD.pad_length_mod | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Spec.Hash.Definitions.hash_alg{Spec.Hash.Definitions.is_md a} ->
base_len: Prims.nat ->
len: Prims.nat
-> FStar.Pervasives.Lemma (requires base_len % Spec.Hash.Definitions.block_length a = 0)
(ensures
Spec.Hash.Definitions.pad_length a (base_len + len) = Spec.Hash.Definitions.pad_length a len
) | {
"end_col": 32,
"end_line": 62,
"start_col": 2,
"start_line": 62
} |
FStar.Pervasives.Lemma | val pad0_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a) | val pad0_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
let pad0_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len) = | false | null | true | mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a) | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"lemma"
] | [
"Spec.Hash.Definitions.hash_alg",
"Prims.b2t",
"Spec.Hash.Definitions.is_md",
"Prims.nat",
"Hacl.Hash.MD.mod_sub_add",
"Spec.Hash.Definitions.block_length",
"Prims.op_Addition",
"Spec.Hash.Definitions.len_length",
"Prims.unit",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Prims.squash",
"Prims.l_or",
"Spec.Hash.Definitions.pad0_length",
"Prims.Nil",
"FStar.Pervasives.pattern"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len) | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pad0_length_mod (a: hash_alg{is_md a}) (base_len len: nat)
: Lemma (requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len) | [] | Hacl.Hash.MD.pad0_length_mod | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Spec.Hash.Definitions.hash_alg{Spec.Hash.Definitions.is_md a} ->
base_len: Prims.nat ->
len: Prims.nat
-> FStar.Pervasives.Lemma (requires base_len % Spec.Hash.Definitions.block_length a = 0)
(ensures
Spec.Hash.Definitions.pad0_length a (base_len + len) =
Spec.Hash.Definitions.pad0_length a len) | {
"end_col": 79,
"end_line": 57,
"start_col": 2,
"start_line": 57
} |
FStar.Pervasives.Lemma | val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
} | val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p = | false | null | true | calc ( == ) {
(a - ((b + c) + d)) % p;
( == ) { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
( == ) { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
( == ) { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
( == ) { () }
(a - (c % p + d) % p) % p;
( == ) { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
( == ) { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
} | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"lemma"
] | [
"Prims.int",
"Prims.pos",
"FStar.Calc.calc_finish",
"Prims.eq2",
"Prims.op_Modulus",
"Prims.op_Subtraction",
"Prims.op_Addition",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"Prims.unit",
"FStar.Calc.calc_step",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"FStar.Math.Lemmas.lemma_mod_sub_distr",
"Prims.squash",
"FStar.Math.Lemmas.lemma_mod_plus_distr_l"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p) | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p) | [] | Hacl.Hash.MD.mod_sub_add | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Prims.int -> b: Prims.int -> c: Prims.int -> d: Prims.int -> p: Prims.pos
-> FStar.Pervasives.Lemma (requires b % p = 0)
(ensures (a - (b + c + d)) % p == (a - (c + d)) % p) | {
"end_col": 3,
"end_line": 51,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val u32_to_len (a: hash_alg{is_md a}) (l: U32.t) : l': len_t a {len_v a l' = U32.v l} | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 u32_to_len (a: hash_alg{is_md a}) (l: U32.t): l':len_t a { len_v a l' = U32.v l } =
match a with
| SHA2_384 | SHA2_512 ->
FStar.Int.Cast.Full.(uint64_to_uint128 (uint32_to_uint64 l))
| _ -> FStar.Int.Cast.Full.uint32_to_uint64 l | val u32_to_len (a: hash_alg{is_md a}) (l: U32.t) : l': len_t a {len_v a l' = U32.v l}
let u32_to_len (a: hash_alg{is_md a}) (l: U32.t) : l': len_t a {len_v a l' = U32.v l} = | false | null | false | match a with
| SHA2_384 | SHA2_512 -> let open FStar.Int.Cast.Full in uint64_to_uint128 (uint32_to_uint64 l)
| _ -> FStar.Int.Cast.Full.uint32_to_uint64 l | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"total"
] | [
"Spec.Hash.Definitions.hash_alg",
"Prims.b2t",
"Spec.Hash.Definitions.is_md",
"FStar.UInt32.t",
"FStar.Int.Cast.Full.uint64_to_uint128",
"FStar.Int.Cast.uint32_to_uint64",
"Spec.Hash.Definitions.len_t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"Spec.Hash.Definitions.len_v",
"FStar.UInt32.v"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction
let len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len))
#push-options "--fuel 0 --ifuel 0 --z3rlimit 300"
(** Iterated compression function. *)
noextract inline_for_extraction
let mk_update_multi a update s () blocks n_blocks =
let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\
B.live h s /\ B.live h blocks /\
B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i:U32.t { U32.(0 <= v i /\ v i < v n_blocks)}): ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1)))
=
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
(**) Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
(**) let h2 = ST.get () in
(**) let blocks_v : Ghost.erased _ = B.as_seq h0 blocks in
(**) let block_v : Ghost.erased _ = B.as_seq h0 block in
(**) let blocks0_v : Ghost.erased _ = B.as_seq h0 blocks0 in
assert (
let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v)
);
(**) let i_block : Ghost.erased _ = block_length a * (U32.v i) in
(**) Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s)
(S.slice blocks_v 0 i_block)
block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f
#pop-options
#push-options "--fuel 0 --ifuel 0 --z3rlimit 400"
(** An arbitrary number of bytes, then padding. *)
noextract inline_for_extraction
let mk_update_last a update_multi =
assert_norm(block_length a > 0);
fun pad s prev_len input input_len ->
ST.push_frame ();
let h0 = ST.get () in
(* Get a series of complete blocks. *)
let blocks_n = U32.(input_len /^ block_len a) in
Math.Lemmas.nat_times_nat_is_nat (UInt32.v blocks_n) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v input_len) (block_length a);
let blocks_len = U32.(blocks_n *^ block_len a) in
Math.Lemmas.cancel_mul_mod (U32.v blocks_n) (block_length a);
assert (U32.v blocks_len % block_length a = 0);
let blocks = B.sub input 0ul blocks_len in
(* The rest that doesn't make up a complete block *)
let rest_len = U32.(input_len -^ blocks_len) in
assert (U32.v rest_len < block_length a);
let rest = B.sub input blocks_len rest_len in
assert(B.length blocks = U32.v blocks_len);
assert(block_length a * U32.v blocks_n = U32.v blocks_n * block_length a);
update_multi s () blocks blocks_n;
let h1 = ST.get () in
assert (S.equal (B.as_seq h0 input) (S.append (B.as_seq h1 blocks) (B.as_seq h1 rest)));
assert (S.equal (as_seq h1 s) (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h0 blocks)));
(* Compute the total number of bytes fed. *)
let total_input_len: len_t a = len_add32 a prev_len input_len in
(* Blit the remaining data and the padding together *)
let pad_len = Hacl.Hash.PadFinish.pad_len a total_input_len in
let tmp_len = U32.( rest_len +^ pad_len ) in
assert (len_v a total_input_len = len_v a prev_len + U32.v blocks_len + U32.v rest_len);
Lemmas.modulo_distributivity (len_v a prev_len) (U32.v blocks_len) (block_length a);
Math.Lemmas.lemma_mod_plus_distr_r (len_v a prev_len) (U32.v blocks_len) (block_length a);
assert ((len_v a prev_len + U32.v blocks_len) % block_length a = 0);
pad_length_mod a (len_v a prev_len + U32.v blocks_len) (U32.v rest_len);
padding_round a total_input_len;
assert(FStar.UInt32.v tmp_len % Spec.Hash.Definitions.block_length a = 0);
assert (U32.v tmp_len % block_length a = 0);
pad_len_bound a prev_len input_len;
assert (U32.v tmp_len <= 2 * block_length a);
let tmp_twoblocks = B.alloca (Lib.IntTypes.u8 0) U32.(2ul *^ block_len a) in
let tmp = B.sub tmp_twoblocks 0ul tmp_len in
let tmp_rest = B.sub tmp 0ul rest_len in
let tmp_pad = B.sub tmp rest_len pad_len in
B.blit rest 0ul tmp_rest 0ul rest_len;
pad total_input_len tmp_pad;
let h2 = ST.get () in
assert (S.equal (B.as_seq h2 tmp) (S.append (B.as_seq h2 tmp_rest) (B.as_seq h2 tmp_pad)));
assert (S.equal (B.as_seq h2 tmp_rest) (B.as_seq h1 rest));
assert (S.equal (B.as_seq h2 tmp_pad) (Spec.Hash.MD.pad a (len_v a total_input_len)));
(* Update multi those last few blocks *)
Math.Lemmas.cancel_mul_mod (U32.v tmp_len) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v tmp_len) (block_length a);
Math.Lemmas.swap_mul (block_length a) (U32.v U32.(tmp_len /^ block_len a));
assert(B.length tmp = block_length a * U32.v U32.(tmp_len /^ block_len a));
update_multi s () tmp U32.(tmp_len /^ block_len a);
let h3 = ST.get () in
assert (S.equal (B.as_seq h3 s)
(Spec.Agile.Hash.update_multi a (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h1 blocks)) ()
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)))));
assert (
let s1 = B.as_seq h1 blocks in
let s2 = B.as_seq h2 rest in
let s3 = Spec.Hash.MD.pad a (len_v a total_input_len) in
S.equal (S.append s1 (S.append s2 s3)) (S.append (S.append s1 s2) s3));
Spec.Hash.Lemmas.update_multi_associative a
(B.as_seq h0 s)
(B.as_seq h1 blocks)
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)));
ST.pop_frame ()
#pop-options
#push-options "--ifuel 1"
noextract inline_for_extraction | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val u32_to_len (a: hash_alg{is_md a}) (l: U32.t) : l': len_t a {len_v a l' = U32.v l} | [] | Hacl.Hash.MD.u32_to_len | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Spec.Hash.Definitions.hash_alg{Spec.Hash.Definitions.is_md a} -> l: FStar.UInt32.t
-> l': Spec.Hash.Definitions.len_t a {Spec.Hash.Definitions.len_v a l' = FStar.UInt32.v l} | {
"end_col": 47,
"end_line": 231,
"start_col": 2,
"start_line": 228
} |
Prims.Tot | val len_add32 (a: hash_alg{not (is_keccak a)})
(prev_len: len_t a)
(input_len: U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a }):
x:len_t a { len_v a x = len_v a prev_len + U32.v input_len } | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len)) | val len_add32 (a: hash_alg{not (is_keccak a)})
(prev_len: len_t a)
(input_len: U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a }):
x:len_t a { len_v a x = len_v a prev_len + U32.v input_len }
let len_add32 a prev_len input_len = | false | null | false | let open FStar.Int.Cast.Full in
match a with
| SHA2_224
| SHA2_256
| MD5
| SHA1
| Blake2S ->
assert_norm (pow2 61 < pow2 64);
let open U64 in prev_len +^ uint32_to_uint64 input_len
| SHA2_384
| SHA2_512
| Blake2B ->
assert_norm (pow2 125 < pow2 128);
let open U128 in prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len) | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"total"
] | [
"Spec.Hash.Definitions.hash_alg",
"Prims.b2t",
"Prims.op_Negation",
"Spec.Hash.Definitions.is_keccak",
"Spec.Hash.Definitions.len_t",
"FStar.UInt32.t",
"Spec.Hash.Definitions.less_than_max_input_length",
"Prims.op_Addition",
"FStar.UInt32.v",
"Spec.Hash.Definitions.len_v",
"FStar.UInt64.op_Plus_Hat",
"FStar.Int.Cast.uint32_to_uint64",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.op_LessThan",
"Prims.pow2",
"FStar.UInt128.op_Plus_Hat",
"FStar.UInt128.uint64_to_uint128",
"Prims.op_Equality",
"Prims.int"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val len_add32 (a: hash_alg{not (is_keccak a)})
(prev_len: len_t a)
(input_len: U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a }):
x:len_t a { len_v a x = len_v a prev_len + U32.v input_len } | [] | Hacl.Hash.MD.len_add32 | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Spec.Hash.Definitions.hash_alg{Prims.op_Negation (Spec.Hash.Definitions.is_keccak a)} ->
prev_len: Spec.Hash.Definitions.len_t a ->
input_len:
FStar.UInt32.t
{ Spec.Hash.Definitions.less_than_max_input_length (FStar.UInt32.v input_len +
Spec.Hash.Definitions.len_v a prev_len)
a }
-> x:
Spec.Hash.Definitions.len_t a
{ Spec.Hash.Definitions.len_v a x =
Spec.Hash.Definitions.len_v a prev_len + FStar.UInt32.v input_len } | {
"end_col": 71,
"end_line": 84,
"start_col": 2,
"start_line": 77
} |
FStar.HyperStack.ST.Stack | val split_blocks (a : hash_alg) (input:B.buffer Int.uint8)
(input_len : Int.size_t { B.length input = U32.v input_len }) :
ST.Stack (Int.size_t & Int.size_t & B.buffer Int.uint8 & Int.size_t & B.buffer Int.uint8)
(requires fun h -> B.live h input /\ B.length input `less_than_max_input_length` a)
(ensures fun h0 (blocks_n, blocks_len, blocks, rest_len, rest) h1 ->
h0 == h1 /\
U32.v blocks_len + U32.v rest_len == U32.v input_len /\
B.length blocks == U32.v blocks_len /\ B.length rest == U32.v rest_len /\
B.as_seq h0 input `S.equal` S.append (B.as_seq h0 blocks) (B.as_seq h0 rest) /\
blocks == Ghost.reveal(B.gsub input 0ul blocks_len) /\
rest == B.gsub input blocks_len rest_len /\
(B.as_seq h0 blocks, B.as_seq h0 rest) ==
Spec.Hash.Incremental.split_blocks a (B.as_seq h0 input) /\
U32.v blocks_len == U32.v blocks_n * block_length a) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": 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 split_blocks a input input_len =
let blocks_n = U32.(input_len /^ block_len a) in
let blocks_n = if U32.(input_len %^ block_len a =^ uint_to_t 0) && U32.(blocks_n >^ uint_to_t 0)
then U32.(blocks_n -^ uint_to_t 1) else blocks_n in
let blocks_len = U32.(blocks_n *^ block_len a) in
let blocks = B.sub input 0ul blocks_len in
let rest_len = U32.(input_len -^ blocks_len) in
let rest = B.sub input blocks_len rest_len in
(blocks_n, blocks_len, blocks, rest_len, rest) | val split_blocks (a : hash_alg) (input:B.buffer Int.uint8)
(input_len : Int.size_t { B.length input = U32.v input_len }) :
ST.Stack (Int.size_t & Int.size_t & B.buffer Int.uint8 & Int.size_t & B.buffer Int.uint8)
(requires fun h -> B.live h input /\ B.length input `less_than_max_input_length` a)
(ensures fun h0 (blocks_n, blocks_len, blocks, rest_len, rest) h1 ->
h0 == h1 /\
U32.v blocks_len + U32.v rest_len == U32.v input_len /\
B.length blocks == U32.v blocks_len /\ B.length rest == U32.v rest_len /\
B.as_seq h0 input `S.equal` S.append (B.as_seq h0 blocks) (B.as_seq h0 rest) /\
blocks == Ghost.reveal(B.gsub input 0ul blocks_len) /\
rest == B.gsub input blocks_len rest_len /\
(B.as_seq h0 blocks, B.as_seq h0 rest) ==
Spec.Hash.Incremental.split_blocks a (B.as_seq h0 input) /\
U32.v blocks_len == U32.v blocks_n * block_length a)
let split_blocks a input input_len = | true | null | false | let blocks_n = let open U32 in input_len /^ block_len a in
let blocks_n =
if U32.(input_len %^ block_len a =^ uint_to_t 0) && U32.(blocks_n >^ uint_to_t 0)
then let open U32 in blocks_n -^ uint_to_t 1
else blocks_n
in
let blocks_len = let open U32 in blocks_n *^ block_len a in
let blocks = B.sub input 0ul blocks_len in
let rest_len = let open U32 in input_len -^ blocks_len in
let rest = B.sub input blocks_len rest_len in
(blocks_n, blocks_len, blocks, rest_len, rest) | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [] | [
"Spec.Hash.Definitions.hash_alg",
"LowStar.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"FStar.UInt.size",
"FStar.UInt32.n",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"FStar.UInt32.v",
"FStar.Pervasives.Native.Mktuple5",
"FStar.Pervasives.Native.tuple5",
"LowStar.Monotonic.Buffer.mbuffer",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"LowStar.Buffer.sub",
"FStar.Ghost.hide",
"FStar.UInt32.t",
"FStar.UInt32.op_Subtraction_Hat",
"FStar.UInt32.__uint_to_t",
"FStar.UInt32.op_Star_Hat",
"Hacl.Hash.Definitions.block_len",
"Prims.op_AmpAmp",
"FStar.UInt32.op_Equals_Hat",
"FStar.UInt32.op_Percent_Hat",
"FStar.UInt32.uint_to_t",
"FStar.UInt32.op_Greater_Hat",
"Prims.bool",
"FStar.UInt32.op_Slash_Hat"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction
let len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len))
#push-options "--fuel 0 --ifuel 0 --z3rlimit 300"
(** Iterated compression function. *)
noextract inline_for_extraction
let mk_update_multi a update s () blocks n_blocks =
let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\
B.live h s /\ B.live h blocks /\
B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i:U32.t { U32.(0 <= v i /\ v i < v n_blocks)}): ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1)))
=
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
(**) Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
(**) let h2 = ST.get () in
(**) let blocks_v : Ghost.erased _ = B.as_seq h0 blocks in
(**) let block_v : Ghost.erased _ = B.as_seq h0 block in
(**) let blocks0_v : Ghost.erased _ = B.as_seq h0 blocks0 in
assert (
let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v)
);
(**) let i_block : Ghost.erased _ = block_length a * (U32.v i) in
(**) Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s)
(S.slice blocks_v 0 i_block)
block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f
#pop-options
#push-options "--fuel 0 --ifuel 0 --z3rlimit 400"
(** An arbitrary number of bytes, then padding. *)
noextract inline_for_extraction
let mk_update_last a update_multi =
assert_norm(block_length a > 0);
fun pad s prev_len input input_len ->
ST.push_frame ();
let h0 = ST.get () in
(* Get a series of complete blocks. *)
let blocks_n = U32.(input_len /^ block_len a) in
Math.Lemmas.nat_times_nat_is_nat (UInt32.v blocks_n) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v input_len) (block_length a);
let blocks_len = U32.(blocks_n *^ block_len a) in
Math.Lemmas.cancel_mul_mod (U32.v blocks_n) (block_length a);
assert (U32.v blocks_len % block_length a = 0);
let blocks = B.sub input 0ul blocks_len in
(* The rest that doesn't make up a complete block *)
let rest_len = U32.(input_len -^ blocks_len) in
assert (U32.v rest_len < block_length a);
let rest = B.sub input blocks_len rest_len in
assert(B.length blocks = U32.v blocks_len);
assert(block_length a * U32.v blocks_n = U32.v blocks_n * block_length a);
update_multi s () blocks blocks_n;
let h1 = ST.get () in
assert (S.equal (B.as_seq h0 input) (S.append (B.as_seq h1 blocks) (B.as_seq h1 rest)));
assert (S.equal (as_seq h1 s) (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h0 blocks)));
(* Compute the total number of bytes fed. *)
let total_input_len: len_t a = len_add32 a prev_len input_len in
(* Blit the remaining data and the padding together *)
let pad_len = Hacl.Hash.PadFinish.pad_len a total_input_len in
let tmp_len = U32.( rest_len +^ pad_len ) in
assert (len_v a total_input_len = len_v a prev_len + U32.v blocks_len + U32.v rest_len);
Lemmas.modulo_distributivity (len_v a prev_len) (U32.v blocks_len) (block_length a);
Math.Lemmas.lemma_mod_plus_distr_r (len_v a prev_len) (U32.v blocks_len) (block_length a);
assert ((len_v a prev_len + U32.v blocks_len) % block_length a = 0);
pad_length_mod a (len_v a prev_len + U32.v blocks_len) (U32.v rest_len);
padding_round a total_input_len;
assert(FStar.UInt32.v tmp_len % Spec.Hash.Definitions.block_length a = 0);
assert (U32.v tmp_len % block_length a = 0);
pad_len_bound a prev_len input_len;
assert (U32.v tmp_len <= 2 * block_length a);
let tmp_twoblocks = B.alloca (Lib.IntTypes.u8 0) U32.(2ul *^ block_len a) in
let tmp = B.sub tmp_twoblocks 0ul tmp_len in
let tmp_rest = B.sub tmp 0ul rest_len in
let tmp_pad = B.sub tmp rest_len pad_len in
B.blit rest 0ul tmp_rest 0ul rest_len;
pad total_input_len tmp_pad;
let h2 = ST.get () in
assert (S.equal (B.as_seq h2 tmp) (S.append (B.as_seq h2 tmp_rest) (B.as_seq h2 tmp_pad)));
assert (S.equal (B.as_seq h2 tmp_rest) (B.as_seq h1 rest));
assert (S.equal (B.as_seq h2 tmp_pad) (Spec.Hash.MD.pad a (len_v a total_input_len)));
(* Update multi those last few blocks *)
Math.Lemmas.cancel_mul_mod (U32.v tmp_len) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v tmp_len) (block_length a);
Math.Lemmas.swap_mul (block_length a) (U32.v U32.(tmp_len /^ block_len a));
assert(B.length tmp = block_length a * U32.v U32.(tmp_len /^ block_len a));
update_multi s () tmp U32.(tmp_len /^ block_len a);
let h3 = ST.get () in
assert (S.equal (B.as_seq h3 s)
(Spec.Agile.Hash.update_multi a (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h1 blocks)) ()
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)))));
assert (
let s1 = B.as_seq h1 blocks in
let s2 = B.as_seq h2 rest in
let s3 = Spec.Hash.MD.pad a (len_v a total_input_len) in
S.equal (S.append s1 (S.append s2 s3)) (S.append (S.append s1 s2) s3));
Spec.Hash.Lemmas.update_multi_associative a
(B.as_seq h0 s)
(B.as_seq h1 blocks)
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)));
ST.pop_frame ()
#pop-options
#push-options "--ifuel 1"
noextract inline_for_extraction
let u32_to_len (a: hash_alg{is_md a}) (l: U32.t): l':len_t a { len_v a l' = U32.v l } =
match a with
| SHA2_384 | SHA2_512 ->
FStar.Int.Cast.Full.(uint64_to_uint128 (uint32_to_uint64 l))
| _ -> FStar.Int.Cast.Full.uint32_to_uint64 l
#pop-options
(** split blocks: utility for the complete hash *)
noextract inline_for_extraction
val split_blocks (a : hash_alg) (input:B.buffer Int.uint8)
(input_len : Int.size_t { B.length input = U32.v input_len }) :
ST.Stack (Int.size_t & Int.size_t & B.buffer Int.uint8 & Int.size_t & B.buffer Int.uint8)
(requires fun h -> B.live h input /\ B.length input `less_than_max_input_length` a)
(ensures fun h0 (blocks_n, blocks_len, blocks, rest_len, rest) h1 ->
h0 == h1 /\
U32.v blocks_len + U32.v rest_len == U32.v input_len /\
B.length blocks == U32.v blocks_len /\ B.length rest == U32.v rest_len /\
B.as_seq h0 input `S.equal` S.append (B.as_seq h0 blocks) (B.as_seq h0 rest) /\
blocks == Ghost.reveal(B.gsub input 0ul blocks_len) /\
rest == B.gsub input blocks_len rest_len /\
(B.as_seq h0 blocks, B.as_seq h0 rest) ==
Spec.Hash.Incremental.split_blocks a (B.as_seq h0 input) /\
U32.v blocks_len == U32.v blocks_n * block_length a) | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val split_blocks (a : hash_alg) (input:B.buffer Int.uint8)
(input_len : Int.size_t { B.length input = U32.v input_len }) :
ST.Stack (Int.size_t & Int.size_t & B.buffer Int.uint8 & Int.size_t & B.buffer Int.uint8)
(requires fun h -> B.live h input /\ B.length input `less_than_max_input_length` a)
(ensures fun h0 (blocks_n, blocks_len, blocks, rest_len, rest) h1 ->
h0 == h1 /\
U32.v blocks_len + U32.v rest_len == U32.v input_len /\
B.length blocks == U32.v blocks_len /\ B.length rest == U32.v rest_len /\
B.as_seq h0 input `S.equal` S.append (B.as_seq h0 blocks) (B.as_seq h0 rest) /\
blocks == Ghost.reveal(B.gsub input 0ul blocks_len) /\
rest == B.gsub input blocks_len rest_len /\
(B.as_seq h0 blocks, B.as_seq h0 rest) ==
Spec.Hash.Incremental.split_blocks a (B.as_seq h0 input) /\
U32.v blocks_len == U32.v blocks_n * block_length a) | [] | Hacl.Hash.MD.split_blocks | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Spec.Hash.Definitions.hash_alg ->
input: LowStar.Buffer.buffer Lib.IntTypes.uint8 ->
input_len: Lib.IntTypes.size_t{LowStar.Monotonic.Buffer.length input = FStar.UInt32.v input_len}
-> FStar.HyperStack.ST.Stack
((((Lib.IntTypes.size_t * Lib.IntTypes.size_t) * LowStar.Buffer.buffer Lib.IntTypes.uint8) *
Lib.IntTypes.size_t) *
LowStar.Buffer.buffer Lib.IntTypes.uint8) | {
"end_col": 48,
"end_line": 261,
"start_col": 36,
"start_line": 253
} |
Prims.Tot | val mk_update_multi: a:legacy_alg -> update:update_st (|a, ()|) -> update_multi_st (|a, ()|) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_update_multi a update s () blocks n_blocks =
let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\
B.live h s /\ B.live h blocks /\
B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i:U32.t { U32.(0 <= v i /\ v i < v n_blocks)}): ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1)))
=
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
(**) Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
(**) let h2 = ST.get () in
(**) let blocks_v : Ghost.erased _ = B.as_seq h0 blocks in
(**) let block_v : Ghost.erased _ = B.as_seq h0 block in
(**) let blocks0_v : Ghost.erased _ = B.as_seq h0 blocks0 in
assert (
let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v)
);
(**) let i_block : Ghost.erased _ = block_length a * (U32.v i) in
(**) Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s)
(S.slice blocks_v 0 i_block)
block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f | val mk_update_multi: a:legacy_alg -> update:update_st (|a, ()|) -> update_multi_st (|a, ()|)
let mk_update_multi a update s () blocks n_blocks = | false | null | false | let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\ B.live h s /\ B.live h blocks /\ B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i: U32.t{let open U32 in 0 <= v i /\ v i < v n_blocks})
: ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1))) =
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
let h2 = ST.get () in
let blocks_v:Ghost.erased _ = B.as_seq h0 blocks in
let block_v:Ghost.erased _ = B.as_seq h0 block in
let blocks0_v:Ghost.erased _ = B.as_seq h0 blocks0 in
assert (let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v));
let i_block:Ghost.erased _ = block_length a * (U32.v i) in
Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s) (S.slice blocks_v 0 i_block) block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"total"
] | [
"Hacl.Hash.MD.legacy_alg",
"Hacl.Hash.Definitions.update_st",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Hacl.Hash.Definitions.state",
"Prims.unit",
"Hacl.Hash.Definitions.blocks_t",
"Hacl.Hash.Definitions.get_alg",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"Lib.IntTypes.uint8",
"LowStar.Buffer.trivial_preorder",
"FStar.Mul.op_Star",
"Spec.Hash.Definitions.block_length",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"C.Loops.for",
"FStar.UInt32.__uint_to_t",
"Spec.Hash.Lemmas.update_multi_zero",
"Hacl.Hash.Definitions.as_seq",
"Prims._assert",
"FStar.UInt32.v",
"FStar.UInt32.t",
"Prims.l_and",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"FStar.Monotonic.HyperStack.mem",
"Prims.op_Addition",
"Spec.Hash.Lemmas.update_multi_associative",
"FStar.Seq.Base.slice",
"FStar.Ghost.reveal",
"FStar.Seq.Base.seq",
"Prims.nat",
"Prims.op_AmpAmp",
"FStar.Seq.Base.length",
"Prims.op_Modulus",
"FStar.Ghost.erased",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.Ghost.hide",
"Prims.op_Subtraction",
"FStar.Seq.Base.equal",
"Hacl.Hash.Definitions.impl_word",
"Spec.Agile.Hash.update_multi",
"FStar.UInt.uint_t",
"LowStar.Monotonic.Buffer.as_seq",
"FStar.HyperStack.ST.get",
"Spec.Hash.Lemmas.update_multi_update",
"LowStar.Monotonic.Buffer.mbuffer",
"LowStar.Buffer.sub",
"FStar.UInt32.op_Star_Hat",
"Prims.l_or",
"Lib.IntTypes.range",
"Prims.op_disEquality",
"Hacl.Hash.Definitions.block_len",
"Prims.logical",
"LowStar.Monotonic.Buffer.live",
"LowStar.Monotonic.Buffer.modifies",
"LowStar.Monotonic.Buffer.loc_buffer",
"Prims.eq2",
"Spec.Hash.Definitions.words_state"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction
let len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len))
#push-options "--fuel 0 --ifuel 0 --z3rlimit 300"
(** Iterated compression function. *) | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 300,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_update_multi: a:legacy_alg -> update:update_st (|a, ()|) -> update_multi_st (|a, ()|) | [] | Hacl.Hash.MD.mk_update_multi | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Hacl.Hash.MD.legacy_alg -> update: Hacl.Hash.Definitions.update_st (| a, () |)
-> Hacl.Hash.Definitions.update_multi_st (| a, () |) | {
"end_col": 32,
"end_line": 131,
"start_col": 51,
"start_line": 90
} |
Prims.Tot | val mk_hash: a:md_alg ->
alloca:alloca_st (|a, ()|) ->
update_multi:update_multi_st (|a, ()|) ->
update_last:update_last_st (|a, ()|) ->
finish:finish_st (|a, ()|) ->
hash_st a | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_hash a alloca update_multi update_last finish input input_len dst =
(**) let h0 = ST.get () in
ST.push_frame ();
let s = alloca () in
let (blocks_n, blocks_len, blocks, rest_len, rest) = split_blocks a input input_len in
(**) let blocks_v0 : Ghost.erased _ = B.as_seq h0 blocks in
(**) let rest_v0 : Ghost.erased _ = B.as_seq h0 rest in
(**) let input_v0 : Ghost.erased _ = B.as_seq h0 input in
(**) assert(input_v0 `S.equal` S.append blocks_v0 rest_v0);
update_multi s () blocks blocks_n;
// AF: Most of these assertions are not needed, but they are good to document
// the current state of the proof
(**) let h01 = ST.get () in
(**) assert (as_seq h01 s == Spec.Agile.Hash.(update_multi a (init a) () blocks_v0));
update_last s (u32_to_len a blocks_len) rest rest_len;
(**) let h02 = ST.get () in
(**) assert (as_seq h02 s == Spec.Agile.Hash.(Spec.Hash.Incremental.update_last a (update_multi a (init a) () blocks_v0) (S.length blocks_v0) rest_v0));
(**) let padding: Ghost.erased _ = Spec.Hash.MD.pad a (S.length input_v0) in
// We need to prove that rest_v0 @| padding is a block. We do this using the calc below
calc (==) {
S.(length (rest_v0 @| padding)) % block_length a;
(==) { }
S.(length rest_v0 + S.length padding) % block_length a;
(==) { Math.Lemmas.lemma_mod_add_distr (S.length padding) (S.length rest_v0) (block_length a) }
S.(length rest_v0 % block_length a + S.length padding) % block_length a;
(==) { }
S.(length input_v0 % block_length a + S.length padding) % block_length a;
(==) { Math.Lemmas.lemma_mod_add_distr (S.length padding) (S.length input_v0) (block_length a) }
S.(length input_v0 + S.length padding) % block_length a;
(==) { }
0;
};
(**) assert (as_seq h02 s == Spec.Agile.Hash.(update_multi a
(update_multi a (init a) () blocks_v0) () (rest_v0 `S.append` padding)));
(**) assert ((blocks_v0 `S.append` (rest_v0 `S.append` padding)) `S.equal` (input_v0 `S.append` padding));
(**) Spec.Hash.Lemmas.update_multi_associative a (Spec.Agile.Hash.init a) (blocks_v0) (rest_v0 `S.append` padding);
(**) assert (as_seq h02 s == Spec.Agile.Hash.(update_multi a (init a) () (input_v0 `S.append` padding)));
finish s dst;
(**) let h03 = ST.get () in
(**) assert (B.as_seq h03 dst == Spec.Agile.Hash.hash a input_v0);
ST.pop_frame () | val mk_hash: a:md_alg ->
alloca:alloca_st (|a, ()|) ->
update_multi:update_multi_st (|a, ()|) ->
update_last:update_last_st (|a, ()|) ->
finish:finish_st (|a, ()|) ->
hash_st a
let mk_hash a alloca update_multi update_last finish input input_len dst = | false | null | false | let h0 = ST.get () in
ST.push_frame ();
let s = alloca () in
let blocks_n, blocks_len, blocks, rest_len, rest = split_blocks a input input_len in
let blocks_v0:Ghost.erased _ = B.as_seq h0 blocks in
let rest_v0:Ghost.erased _ = B.as_seq h0 rest in
let input_v0:Ghost.erased _ = B.as_seq h0 input in
assert (input_v0 `S.equal` (S.append blocks_v0 rest_v0));
update_multi s () blocks blocks_n;
let h01 = ST.get () in
assert (as_seq h01 s == Spec.Agile.Hash.(update_multi a (init a) () blocks_v0));
update_last s (u32_to_len a blocks_len) rest rest_len;
let h02 = ST.get () in
assert (as_seq h02 s ==
Spec.Agile.Hash.(Spec.Hash.Incremental.update_last a
(update_multi a (init a) () blocks_v0)
(S.length blocks_v0)
rest_v0));
let padding:Ghost.erased _ = Spec.Hash.MD.pad a (S.length input_v0) in
calc ( == ) {
S.(length (rest_v0 @| padding)) % block_length a;
( == ) { () }
S.(length rest_v0 + S.length padding) % block_length a;
( == ) { Math.Lemmas.lemma_mod_add_distr (S.length padding) (S.length rest_v0) (block_length a) }
S.(length rest_v0 % block_length a + S.length padding) % block_length a;
( == ) { () }
S.(length input_v0 % block_length a + S.length padding) % block_length a;
( == ) { Math.Lemmas.lemma_mod_add_distr (S.length padding) (S.length input_v0) (block_length a) }
S.(length input_v0 + S.length padding) % block_length a;
( == ) { () }
0;
};
assert (as_seq h02 s ==
Spec.Agile.Hash.(update_multi a
(update_multi a (init a) () blocks_v0)
()
(rest_v0 `S.append` padding)));
assert ((blocks_v0 `S.append` (rest_v0 `S.append` padding)) `S.equal` (input_v0 `S.append` padding));
Spec.Hash.Lemmas.update_multi_associative a
(Spec.Agile.Hash.init a)
(blocks_v0)
(rest_v0 `S.append` padding);
assert (as_seq h02 s == Spec.Agile.Hash.(update_multi a (init a) () (input_v0 `S.append` padding)));
finish s dst;
let h03 = ST.get () in
assert (B.as_seq h03 dst == Spec.Agile.Hash.hash a input_v0);
ST.pop_frame () | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"total"
] | [
"Spec.Hash.Definitions.md_alg",
"Hacl.Hash.Definitions.alloca_st",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Hacl.Hash.Definitions.update_multi_st",
"Hacl.Hash.Definitions.update_last_st",
"Hacl.Hash.Definitions.finish_st",
"LowStar.Buffer.buffer",
"Lib.IntTypes.uint8",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"Hacl.Hash.Definitions.hash_t",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"FStar.Seq.Base.seq",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"LowStar.Monotonic.Buffer.as_seq",
"Spec.Agile.Hash.hash",
"FStar.Ghost.reveal",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"Spec.Hash.Definitions.words_state",
"Hacl.Hash.Definitions.get_alg",
"Hacl.Hash.Definitions.as_seq",
"Spec.Agile.Hash.update_multi",
"Spec.Agile.Hash.init",
"FStar.Seq.Base.append",
"Spec.Hash.Lemmas.update_multi_associative",
"Prims.l_and",
"Prims.op_Modulus",
"FStar.Seq.Base.length",
"Spec.Hash.Definitions.block_length",
"FStar.Seq.Base.equal",
"FStar.Calc.calc_finish",
"FStar.Seq.Base.op_At_Bar",
"Prims.Cons",
"FStar.Preorder.relation",
"Prims.Nil",
"FStar.Calc.calc_step",
"Prims.op_Addition",
"FStar.Calc.calc_init",
"FStar.Calc.calc_pack",
"Prims.squash",
"FStar.Math.Lemmas.lemma_mod_add_distr",
"FStar.Ghost.erased",
"Lib.IntTypes.int_t",
"FStar.Ghost.hide",
"Spec.Hash.MD.pad",
"Spec.Hash.Incremental.Definitions.update_last",
"Hacl.Hash.MD.u32_to_len",
"FStar.Pervasives.Native.tuple5",
"Hacl.Hash.MD.split_blocks",
"Hacl.Hash.Definitions.state",
"FStar.HyperStack.ST.push_frame"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction
let len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len))
#push-options "--fuel 0 --ifuel 0 --z3rlimit 300"
(** Iterated compression function. *)
noextract inline_for_extraction
let mk_update_multi a update s () blocks n_blocks =
let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\
B.live h s /\ B.live h blocks /\
B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i:U32.t { U32.(0 <= v i /\ v i < v n_blocks)}): ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1)))
=
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
(**) Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
(**) let h2 = ST.get () in
(**) let blocks_v : Ghost.erased _ = B.as_seq h0 blocks in
(**) let block_v : Ghost.erased _ = B.as_seq h0 block in
(**) let blocks0_v : Ghost.erased _ = B.as_seq h0 blocks0 in
assert (
let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v)
);
(**) let i_block : Ghost.erased _ = block_length a * (U32.v i) in
(**) Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s)
(S.slice blocks_v 0 i_block)
block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f
#pop-options
#push-options "--fuel 0 --ifuel 0 --z3rlimit 400"
(** An arbitrary number of bytes, then padding. *)
noextract inline_for_extraction
let mk_update_last a update_multi =
assert_norm(block_length a > 0);
fun pad s prev_len input input_len ->
ST.push_frame ();
let h0 = ST.get () in
(* Get a series of complete blocks. *)
let blocks_n = U32.(input_len /^ block_len a) in
Math.Lemmas.nat_times_nat_is_nat (UInt32.v blocks_n) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v input_len) (block_length a);
let blocks_len = U32.(blocks_n *^ block_len a) in
Math.Lemmas.cancel_mul_mod (U32.v blocks_n) (block_length a);
assert (U32.v blocks_len % block_length a = 0);
let blocks = B.sub input 0ul blocks_len in
(* The rest that doesn't make up a complete block *)
let rest_len = U32.(input_len -^ blocks_len) in
assert (U32.v rest_len < block_length a);
let rest = B.sub input blocks_len rest_len in
assert(B.length blocks = U32.v blocks_len);
assert(block_length a * U32.v blocks_n = U32.v blocks_n * block_length a);
update_multi s () blocks blocks_n;
let h1 = ST.get () in
assert (S.equal (B.as_seq h0 input) (S.append (B.as_seq h1 blocks) (B.as_seq h1 rest)));
assert (S.equal (as_seq h1 s) (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h0 blocks)));
(* Compute the total number of bytes fed. *)
let total_input_len: len_t a = len_add32 a prev_len input_len in
(* Blit the remaining data and the padding together *)
let pad_len = Hacl.Hash.PadFinish.pad_len a total_input_len in
let tmp_len = U32.( rest_len +^ pad_len ) in
assert (len_v a total_input_len = len_v a prev_len + U32.v blocks_len + U32.v rest_len);
Lemmas.modulo_distributivity (len_v a prev_len) (U32.v blocks_len) (block_length a);
Math.Lemmas.lemma_mod_plus_distr_r (len_v a prev_len) (U32.v blocks_len) (block_length a);
assert ((len_v a prev_len + U32.v blocks_len) % block_length a = 0);
pad_length_mod a (len_v a prev_len + U32.v blocks_len) (U32.v rest_len);
padding_round a total_input_len;
assert(FStar.UInt32.v tmp_len % Spec.Hash.Definitions.block_length a = 0);
assert (U32.v tmp_len % block_length a = 0);
pad_len_bound a prev_len input_len;
assert (U32.v tmp_len <= 2 * block_length a);
let tmp_twoblocks = B.alloca (Lib.IntTypes.u8 0) U32.(2ul *^ block_len a) in
let tmp = B.sub tmp_twoblocks 0ul tmp_len in
let tmp_rest = B.sub tmp 0ul rest_len in
let tmp_pad = B.sub tmp rest_len pad_len in
B.blit rest 0ul tmp_rest 0ul rest_len;
pad total_input_len tmp_pad;
let h2 = ST.get () in
assert (S.equal (B.as_seq h2 tmp) (S.append (B.as_seq h2 tmp_rest) (B.as_seq h2 tmp_pad)));
assert (S.equal (B.as_seq h2 tmp_rest) (B.as_seq h1 rest));
assert (S.equal (B.as_seq h2 tmp_pad) (Spec.Hash.MD.pad a (len_v a total_input_len)));
(* Update multi those last few blocks *)
Math.Lemmas.cancel_mul_mod (U32.v tmp_len) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v tmp_len) (block_length a);
Math.Lemmas.swap_mul (block_length a) (U32.v U32.(tmp_len /^ block_len a));
assert(B.length tmp = block_length a * U32.v U32.(tmp_len /^ block_len a));
update_multi s () tmp U32.(tmp_len /^ block_len a);
let h3 = ST.get () in
assert (S.equal (B.as_seq h3 s)
(Spec.Agile.Hash.update_multi a (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h1 blocks)) ()
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)))));
assert (
let s1 = B.as_seq h1 blocks in
let s2 = B.as_seq h2 rest in
let s3 = Spec.Hash.MD.pad a (len_v a total_input_len) in
S.equal (S.append s1 (S.append s2 s3)) (S.append (S.append s1 s2) s3));
Spec.Hash.Lemmas.update_multi_associative a
(B.as_seq h0 s)
(B.as_seq h1 blocks)
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)));
ST.pop_frame ()
#pop-options
#push-options "--ifuel 1"
noextract inline_for_extraction
let u32_to_len (a: hash_alg{is_md a}) (l: U32.t): l':len_t a { len_v a l' = U32.v l } =
match a with
| SHA2_384 | SHA2_512 ->
FStar.Int.Cast.Full.(uint64_to_uint128 (uint32_to_uint64 l))
| _ -> FStar.Int.Cast.Full.uint32_to_uint64 l
#pop-options
(** split blocks: utility for the complete hash *)
noextract inline_for_extraction
val split_blocks (a : hash_alg) (input:B.buffer Int.uint8)
(input_len : Int.size_t { B.length input = U32.v input_len }) :
ST.Stack (Int.size_t & Int.size_t & B.buffer Int.uint8 & Int.size_t & B.buffer Int.uint8)
(requires fun h -> B.live h input /\ B.length input `less_than_max_input_length` a)
(ensures fun h0 (blocks_n, blocks_len, blocks, rest_len, rest) h1 ->
h0 == h1 /\
U32.v blocks_len + U32.v rest_len == U32.v input_len /\
B.length blocks == U32.v blocks_len /\ B.length rest == U32.v rest_len /\
B.as_seq h0 input `S.equal` S.append (B.as_seq h0 blocks) (B.as_seq h0 rest) /\
blocks == Ghost.reveal(B.gsub input 0ul blocks_len) /\
rest == B.gsub input blocks_len rest_len /\
(B.as_seq h0 blocks, B.as_seq h0 rest) ==
Spec.Hash.Incremental.split_blocks a (B.as_seq h0 input) /\
U32.v blocks_len == U32.v blocks_n * block_length a)
#push-options "--ifuel 1"
let split_blocks a input input_len =
let blocks_n = U32.(input_len /^ block_len a) in
let blocks_n = if U32.(input_len %^ block_len a =^ uint_to_t 0) && U32.(blocks_n >^ uint_to_t 0)
then U32.(blocks_n -^ uint_to_t 1) else blocks_n in
let blocks_len = U32.(blocks_n *^ block_len a) in
let blocks = B.sub input 0ul blocks_len in
let rest_len = U32.(input_len -^ blocks_len) in
let rest = B.sub input blocks_len rest_len in
(blocks_n, blocks_len, blocks, rest_len, rest)
#pop-options
(** Complete hash. *)
/// We need to friend Spec.Agile.Hash to expose the definition of hash
friend Spec.Agile.Hash
#push-options "--ifuel 0 --fuel 0 --z3rlimit 200" | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 200,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_hash: a:md_alg ->
alloca:alloca_st (|a, ()|) ->
update_multi:update_multi_st (|a, ()|) ->
update_last:update_last_st (|a, ()|) ->
finish:finish_st (|a, ()|) ->
hash_st a | [] | Hacl.Hash.MD.mk_hash | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Spec.Hash.Definitions.md_alg ->
alloca: Hacl.Hash.Definitions.alloca_st (| a, () |) ->
update_multi: Hacl.Hash.Definitions.update_multi_st (| a, () |) ->
update_last: Hacl.Hash.Definitions.update_last_st (| a, () |) ->
finish: Hacl.Hash.Definitions.finish_st (| a, () |)
-> Hacl.Hash.Definitions.hash_st a | {
"end_col": 17,
"end_line": 317,
"start_col": 74,
"start_line": 271
} |
Prims.Tot | val mk_update_last: a:legacy_alg -> update_multi_st (|a, ()|) -> pad_st a -> update_last_st (|a, ()|) | [
{
"abbrev": true,
"full_module": "Spec.Agile.Hash",
"short_module": "AH"
},
{
"abbrev": true,
"full_module": "Spec.Hash.Incremental",
"short_module": "HI"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.Math.Lemmas",
"short_module": "Lemmas"
},
{
"abbrev": true,
"full_module": "Lib.IntTypes",
"short_module": "Int"
},
{
"abbrev": true,
"full_module": "FStar.UInt128",
"short_module": "U128"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Hash",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_update_last a update_multi =
assert_norm(block_length a > 0);
fun pad s prev_len input input_len ->
ST.push_frame ();
let h0 = ST.get () in
(* Get a series of complete blocks. *)
let blocks_n = U32.(input_len /^ block_len a) in
Math.Lemmas.nat_times_nat_is_nat (UInt32.v blocks_n) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v input_len) (block_length a);
let blocks_len = U32.(blocks_n *^ block_len a) in
Math.Lemmas.cancel_mul_mod (U32.v blocks_n) (block_length a);
assert (U32.v blocks_len % block_length a = 0);
let blocks = B.sub input 0ul blocks_len in
(* The rest that doesn't make up a complete block *)
let rest_len = U32.(input_len -^ blocks_len) in
assert (U32.v rest_len < block_length a);
let rest = B.sub input blocks_len rest_len in
assert(B.length blocks = U32.v blocks_len);
assert(block_length a * U32.v blocks_n = U32.v blocks_n * block_length a);
update_multi s () blocks blocks_n;
let h1 = ST.get () in
assert (S.equal (B.as_seq h0 input) (S.append (B.as_seq h1 blocks) (B.as_seq h1 rest)));
assert (S.equal (as_seq h1 s) (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h0 blocks)));
(* Compute the total number of bytes fed. *)
let total_input_len: len_t a = len_add32 a prev_len input_len in
(* Blit the remaining data and the padding together *)
let pad_len = Hacl.Hash.PadFinish.pad_len a total_input_len in
let tmp_len = U32.( rest_len +^ pad_len ) in
assert (len_v a total_input_len = len_v a prev_len + U32.v blocks_len + U32.v rest_len);
Lemmas.modulo_distributivity (len_v a prev_len) (U32.v blocks_len) (block_length a);
Math.Lemmas.lemma_mod_plus_distr_r (len_v a prev_len) (U32.v blocks_len) (block_length a);
assert ((len_v a prev_len + U32.v blocks_len) % block_length a = 0);
pad_length_mod a (len_v a prev_len + U32.v blocks_len) (U32.v rest_len);
padding_round a total_input_len;
assert(FStar.UInt32.v tmp_len % Spec.Hash.Definitions.block_length a = 0);
assert (U32.v tmp_len % block_length a = 0);
pad_len_bound a prev_len input_len;
assert (U32.v tmp_len <= 2 * block_length a);
let tmp_twoblocks = B.alloca (Lib.IntTypes.u8 0) U32.(2ul *^ block_len a) in
let tmp = B.sub tmp_twoblocks 0ul tmp_len in
let tmp_rest = B.sub tmp 0ul rest_len in
let tmp_pad = B.sub tmp rest_len pad_len in
B.blit rest 0ul tmp_rest 0ul rest_len;
pad total_input_len tmp_pad;
let h2 = ST.get () in
assert (S.equal (B.as_seq h2 tmp) (S.append (B.as_seq h2 tmp_rest) (B.as_seq h2 tmp_pad)));
assert (S.equal (B.as_seq h2 tmp_rest) (B.as_seq h1 rest));
assert (S.equal (B.as_seq h2 tmp_pad) (Spec.Hash.MD.pad a (len_v a total_input_len)));
(* Update multi those last few blocks *)
Math.Lemmas.cancel_mul_mod (U32.v tmp_len) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v tmp_len) (block_length a);
Math.Lemmas.swap_mul (block_length a) (U32.v U32.(tmp_len /^ block_len a));
assert(B.length tmp = block_length a * U32.v U32.(tmp_len /^ block_len a));
update_multi s () tmp U32.(tmp_len /^ block_len a);
let h3 = ST.get () in
assert (S.equal (B.as_seq h3 s)
(Spec.Agile.Hash.update_multi a (Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h1 blocks)) ()
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)))));
assert (
let s1 = B.as_seq h1 blocks in
let s2 = B.as_seq h2 rest in
let s3 = Spec.Hash.MD.pad a (len_v a total_input_len) in
S.equal (S.append s1 (S.append s2 s3)) (S.append (S.append s1 s2) s3));
Spec.Hash.Lemmas.update_multi_associative a
(B.as_seq h0 s)
(B.as_seq h1 blocks)
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)));
ST.pop_frame () | val mk_update_last: a:legacy_alg -> update_multi_st (|a, ()|) -> pad_st a -> update_last_st (|a, ()|)
let mk_update_last a update_multi = | false | null | false | assert_norm (block_length a > 0);
fun pad s prev_len input input_len ->
ST.push_frame ();
let h0 = ST.get () in
let blocks_n = let open U32 in input_len /^ block_len a in
Math.Lemmas.nat_times_nat_is_nat (UInt32.v blocks_n) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v input_len) (block_length a);
let blocks_len = let open U32 in blocks_n *^ block_len a in
Math.Lemmas.cancel_mul_mod (U32.v blocks_n) (block_length a);
assert (U32.v blocks_len % block_length a = 0);
let blocks = B.sub input 0ul blocks_len in
let rest_len = let open U32 in input_len -^ blocks_len in
assert (U32.v rest_len < block_length a);
let rest = B.sub input blocks_len rest_len in
assert (B.length blocks = U32.v blocks_len);
assert (block_length a * U32.v blocks_n = U32.v blocks_n * block_length a);
update_multi s () blocks blocks_n;
let h1 = ST.get () in
assert (S.equal (B.as_seq h0 input) (S.append (B.as_seq h1 blocks) (B.as_seq h1 rest)));
assert (S.equal (as_seq h1 s)
(Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h0 blocks)));
let total_input_len:len_t a = len_add32 a prev_len input_len in
let pad_len = Hacl.Hash.PadFinish.pad_len a total_input_len in
let tmp_len = let open U32 in rest_len +^ pad_len in
assert (len_v a total_input_len = len_v a prev_len + U32.v blocks_len + U32.v rest_len);
Lemmas.modulo_distributivity (len_v a prev_len) (U32.v blocks_len) (block_length a);
Math.Lemmas.lemma_mod_plus_distr_r (len_v a prev_len) (U32.v blocks_len) (block_length a);
assert ((len_v a prev_len + U32.v blocks_len) % block_length a = 0);
pad_length_mod a (len_v a prev_len + U32.v blocks_len) (U32.v rest_len);
padding_round a total_input_len;
assert (FStar.UInt32.v tmp_len % Spec.Hash.Definitions.block_length a = 0);
assert (U32.v tmp_len % block_length a = 0);
pad_len_bound a prev_len input_len;
assert (U32.v tmp_len <= 2 * block_length a);
let tmp_twoblocks = B.alloca (Lib.IntTypes.u8 0) U32.(2ul *^ block_len a) in
let tmp = B.sub tmp_twoblocks 0ul tmp_len in
let tmp_rest = B.sub tmp 0ul rest_len in
let tmp_pad = B.sub tmp rest_len pad_len in
B.blit rest 0ul tmp_rest 0ul rest_len;
pad total_input_len tmp_pad;
let h2 = ST.get () in
assert (S.equal (B.as_seq h2 tmp) (S.append (B.as_seq h2 tmp_rest) (B.as_seq h2 tmp_pad)));
assert (S.equal (B.as_seq h2 tmp_rest) (B.as_seq h1 rest));
assert (S.equal (B.as_seq h2 tmp_pad) (Spec.Hash.MD.pad a (len_v a total_input_len)));
Math.Lemmas.cancel_mul_mod (U32.v tmp_len) (block_length a);
Math.Lemmas.euclidean_division_definition (U32.v tmp_len) (block_length a);
Math.Lemmas.swap_mul (block_length a) (U32.v U32.(tmp_len /^ block_len a));
assert (B.length tmp = block_length a * U32.v U32.(tmp_len /^ block_len a));
update_multi s () tmp U32.(tmp_len /^ block_len a);
let h3 = ST.get () in
assert (S.equal (B.as_seq h3 s)
(Spec.Agile.Hash.update_multi a
(Spec.Agile.Hash.update_multi a (B.as_seq h0 s) () (B.as_seq h1 blocks))
()
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)))));
assert (let s1 = B.as_seq h1 blocks in
let s2 = B.as_seq h2 rest in
let s3 = Spec.Hash.MD.pad a (len_v a total_input_len) in
S.equal (S.append s1 (S.append s2 s3)) (S.append (S.append s1 s2) s3));
Spec.Hash.Lemmas.update_multi_associative a
(B.as_seq h0 s)
(B.as_seq h1 blocks)
(S.append (B.as_seq h1 rest) (Spec.Hash.MD.pad a (len_v a total_input_len)));
ST.pop_frame () | {
"checked_file": "Hacl.Hash.MD.fst.checked",
"dependencies": [
"Spec.Hash.MD.fst.checked",
"Spec.Hash.Lemmas.fsti.checked",
"Spec.Hash.Incremental.fsti.checked",
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.Hash.fst.checked",
"Spec.Agile.Hash.fst.checked",
"prims.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Hash.PadFinish.fsti.checked",
"Hacl.Hash.Lemmas.fst.checked",
"Hacl.Hash.Definitions.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt128.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.Cast.Full.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked",
"C.Loops.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Hash.MD.fst"
} | [
"total"
] | [
"Hacl.Hash.MD.legacy_alg",
"Hacl.Hash.Definitions.update_multi_st",
"Prims.Mkdtuple2",
"Spec.Hash.Definitions.hash_alg",
"Hacl.Hash.Definitions.m_spec",
"Hacl.Hash.Definitions.pad_st",
"Hacl.Hash.Definitions.state",
"Hacl.Hash.Definitions.prev_len_t",
"Hacl.Hash.Definitions.get_alg",
"LowStar.Buffer.buffer",
"Lib.IntTypes.uint8",
"Prims.l_and",
"Spec.Hash.Definitions.is_keccak",
"Prims.l_True",
"Prims.bool",
"Prims.b2t",
"Spec.Hash.Definitions.less_than_max_input_length",
"Prims.op_Addition",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"Spec.Hash.Definitions.len_v",
"Prims.logical",
"Prims.op_LessThanOrEqual",
"Spec.Hash.Definitions.block_length",
"Lib.IntTypes.size_t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"Prims.op_GreaterThanOrEqual",
"Lib.IntTypes.range",
"Lib.IntTypes.U32",
"Lib.IntTypes.v",
"Lib.IntTypes.PUB",
"FStar.HyperStack.ST.pop_frame",
"Prims.unit",
"Spec.Hash.Lemmas.update_multi_associative",
"LowStar.Monotonic.Buffer.as_seq",
"Hacl.Hash.Definitions.impl_word",
"FStar.Seq.Base.append",
"Spec.Hash.MD.pad",
"Prims._assert",
"FStar.Seq.Base.equal",
"Spec.Hash.Definitions.bytes",
"Prims.op_Modulus",
"FStar.Seq.Base.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.Seq.Base.seq",
"Spec.Agile.Hash.update_multi",
"FStar.Monotonic.HyperStack.mem",
"FStar.HyperStack.ST.get",
"FStar.UInt32.op_Slash_Hat",
"Hacl.Hash.Definitions.block_len",
"FStar.Mul.op_Star",
"FStar.UInt32.v",
"FStar.Math.Lemmas.swap_mul",
"FStar.Math.Lemmas.euclidean_division_definition",
"FStar.Math.Lemmas.cancel_mul_mod",
"LowStar.Monotonic.Buffer.blit",
"FStar.UInt32.__uint_to_t",
"LowStar.Monotonic.Buffer.mbuffer",
"LowStar.Buffer.sub",
"FStar.Ghost.hide",
"FStar.UInt32.t",
"Prims.eq2",
"Prims.nat",
"FStar.UInt32.mul",
"FStar.UInt32.uint_to_t",
"Prims.op_Negation",
"LowStar.Monotonic.Buffer.g_is_null",
"LowStar.Buffer.alloca",
"Lib.IntTypes.u8",
"FStar.UInt32.op_Star_Hat",
"Hacl.Hash.MD.pad_len_bound",
"Hacl.Hash.MD.padding_round",
"Hacl.Hash.MD.pad_length_mod",
"FStar.Math.Lemmas.lemma_mod_plus_distr_r",
"FStar.Math.Lemmas.modulo_distributivity",
"FStar.UInt32.op_Plus_Hat",
"FStar.UInt.size",
"Spec.Hash.Definitions.pad_length",
"Hacl.Hash.PadFinish.pad_len",
"Spec.Hash.Definitions.len_t",
"Hacl.Hash.MD.len_add32",
"Spec.Hash.Definitions.word",
"Hacl.Hash.Definitions.as_seq",
"FStar.UInt32.n",
"Prims.op_LessThan",
"FStar.UInt32.op_Subtraction_Hat",
"FStar.Math.Lemmas.nat_times_nat_is_nat",
"FStar.HyperStack.ST.push_frame",
"FStar.Pervasives.assert_norm",
"Prims.op_GreaterThan",
"Hacl.Hash.Definitions.update_last_st"
] | [] | module Hacl.Hash.MD
(** The Merkle-Damgård construction. *)
module U8 = FStar.UInt8
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module U128 = FStar.UInt128
module Int = Lib.IntTypes
module Lemmas = FStar.Math.Lemmas
module B = LowStar.Buffer
module S = FStar.Seq
module HS = FStar.HyperStack
module ST = FStar.HyperStack.ST
open Hacl.Hash.Definitions
open Hacl.Hash.Lemmas
open Spec.Hash.Definitions
open FStar.Mul
module HI = Spec.Hash.Incremental
module AH = Spec.Agile.Hash
(** Auxiliary helpers *)
#set-options "--max_fuel 0 --max_ifuel 0 --z3rlimit 100"
let padding_round (a: md_alg) (len: len_t a): Lemma
((len_v a len + pad_length a (len_v a len)) % block_length a = 0)
=
()
private
val mod_sub_add: a:int -> b:int -> c:int -> d:int -> p:pos -> Lemma
(requires b % p = 0)
(ensures (a - ((b + c) + d)) % p == (a - (c + d)) % p)
let mod_sub_add a b c d p =
calc (==) {
(a - ((b + c) + d)) % p;
== { Math.Lemmas.lemma_mod_sub_distr a ((b + c) + d) p }
(a - ((b + c) + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l (b + c) d p }
(a - ((b + c) % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l b c p }
(a - ((b % p + c) % p + d) % p) % p;
== { }
(a - (c % p + d) % p) % p;
== { Math.Lemmas.lemma_mod_plus_distr_l c d p }
(a - (c + d) % p) % p;
== { Math.Lemmas.lemma_mod_sub_distr a (c + d) p }
(a - (c + d)) % p;
}
let pad0_length_mod (a: hash_alg{is_md a}) (base_len: nat) (len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad0_length a (base_len + len) = pad0_length a len)
=
mod_sub_add (block_length a) base_len len (len_length a + 1) (block_length a)
let pad_length_mod (a: hash_alg{is_md a}) (base_len len: nat): Lemma
(requires base_len % block_length a = 0)
(ensures pad_length a (base_len + len) = pad_length a len)
= pad0_length_mod a base_len len
val pad_len_bound :
a : md_alg ->
prev_len:len_t a { len_v a prev_len % block_length a = 0 } ->
input_len:U32.t { (U32.v input_len + len_v a prev_len) `less_than_max_input_length` a} ->
Lemma(
(U32.v input_len % block_length a) +
pad_length a (len_v a prev_len + U32.v input_len) <= 2 * block_length a)
let pad_len_bound a prev_len input_len = ()
(* Avoiding an ill-formed pattern error... *)
noextract inline_for_extraction
let len_add32 a prev_len input_len =
let open FStar.Int.Cast.Full in
match a with
| SHA2_224 | SHA2_256 | MD5 | SHA1 | Blake2S ->
assert_norm (pow2 61 < pow2 64);
U64.(prev_len +^ uint32_to_uint64 input_len)
| SHA2_384 | SHA2_512 | Blake2B ->
assert_norm (pow2 125 < pow2 128);
U128.(prev_len +^ uint64_to_uint128 (uint32_to_uint64 input_len))
#push-options "--fuel 0 --ifuel 0 --z3rlimit 300"
(** Iterated compression function. *)
noextract inline_for_extraction
let mk_update_multi a update s () blocks n_blocks =
let h0 = ST.get () in
let inv (h: HS.mem) (i: nat) =
let i_block = i * block_length a in
i <= U32.v n_blocks /\
B.live h s /\ B.live h blocks /\
B.(modifies (loc_buffer s) h0 h) /\
as_seq h s ==
Spec.Agile.Hash.update_multi a (as_seq h0 s) () (S.slice (B.as_seq h0 blocks) 0 i_block)
in
let f (i:U32.t { U32.(0 <= v i /\ v i < v n_blocks)}): ST.Stack unit
(requires (fun h -> inv h (U32.v i)))
(ensures (fun h0 _ h1 -> inv h0 (U32.v i) /\ inv h1 (U32.v i + 1)))
=
let h1 = ST.get () in
let sz = block_len a in
let blocks0 = B.sub blocks 0ul U32.(sz *^ i) in
let block = B.sub blocks U32.(sz *^ i) sz in
update s block;
(**) Spec.Hash.Lemmas.update_multi_update a (as_seq h1 s) (B.as_seq h0 block);
(**) let h2 = ST.get () in
(**) let blocks_v : Ghost.erased _ = B.as_seq h0 blocks in
(**) let block_v : Ghost.erased _ = B.as_seq h0 block in
(**) let blocks0_v : Ghost.erased _ = B.as_seq h0 blocks0 in
assert (
let s1 = B.as_seq h1 s in
let s2 = B.as_seq h2 s in
let i = U32.v i in
let n_blocks = U32.v n_blocks in
block_length a * (i + 1) <= S.length blocks_v /\
(block_length a * (i + 1) - block_length a * i) % block_length a = 0 /\
S.equal block_v (S.slice blocks_v (block_length a * i) (block_length a * (i + 1))) /\
S.equal s2 (Spec.Agile.Hash.update_multi a s1 () block_v)
);
(**) let i_block : Ghost.erased _ = block_length a * (U32.v i) in
(**) Spec.Hash.Lemmas.update_multi_associative a (as_seq h0 s)
(S.slice blocks_v 0 i_block)
block_v
in
assert (B.length blocks = U32.v n_blocks * block_length a);
Spec.Hash.Lemmas.update_multi_zero a (as_seq h0 s);
C.Loops.for 0ul n_blocks inv f
#pop-options
#push-options "--fuel 0 --ifuel 0 --z3rlimit 400"
(** An arbitrary number of bytes, then padding. *)
noextract inline_for_extraction | false | false | Hacl.Hash.MD.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 400,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_update_last: a:legacy_alg -> update_multi_st (|a, ()|) -> pad_st a -> update_last_st (|a, ()|) | [] | Hacl.Hash.MD.mk_update_last | {
"file_name": "code/hash/Hacl.Hash.MD.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Hacl.Hash.MD.legacy_alg ->
update_multi: Hacl.Hash.Definitions.update_multi_st (| a, () |) ->
_: Hacl.Hash.Definitions.pad_st a
-> Hacl.Hash.Definitions.update_last_st (| a, () |) | {
"end_col": 17,
"end_line": 220,
"start_col": 2,
"start_line": 140
} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.