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 va_codegen_success_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cmovc64 dst src =
(va_ttrue ()) | val va_codegen_success_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Cmovc64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cmovc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 51,
"start_col": 2,
"start_line": 51
} |
Prims.Tot | val va_codegen_success_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Add64 dst src =
(va_ttrue ()) | val va_codegen_success_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Add64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Add64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 80,
"start_col": 2,
"start_line": 80
} |
Prims.Tot | val va_code_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src)) | val va_code_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Add64 dst src = | false | null | false | (mk_ins (make_instr (I.ins_Add64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Add64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Add64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 45,
"end_line": 76,
"start_col": 2,
"start_line": 76
} |
Prims.Tot | val va_code_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64
-> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) | val va_code_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64
-> Tot va_code
let va_code_AddLea64 dst src1 src2 = | false | null | false | (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_AddLea64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 -> src2:va_operand_opr64
-> Tot va_code | [] | Vale.X64.InsBasic.va_code_AddLea64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src1: Vale.X64.Decls.va_operand_opr64 ->
src2: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 54,
"end_line": 136,
"start_col": 2,
"start_line": 136
} |
Prims.Tot | val va_codegen_success_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Add64Wrap dst src =
(va_ttrue ()) | val va_codegen_success_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Add64Wrap dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Add64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 110,
"start_col": 2,
"start_line": 110
} |
Prims.Tot | val va_codegen_success_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ()) | val va_codegen_success_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_AddLea64 dst src1 src2 = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_AddLea64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src1: Vale.X64.Decls.va_operand_opr64 ->
src2: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 140,
"start_col": 2,
"start_line": 140
} |
Prims.Tot | val va_codegen_success_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Adc64 dst src =
(va_ttrue ()) | val va_codegen_success_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adc64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Adc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 169,
"start_col": 2,
"start_line": 169
} |
Prims.Tot | val va_code_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src)) | val va_code_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adc64 dst src = | false | null | false | (mk_ins (make_instr (I.ins_AddCarry64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_AddCarry64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Adc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 50,
"end_line": 165,
"start_col": 2,
"start_line": 165
} |
Prims.Tot | val va_code_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src)) | val va_code_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adc64Wrap dst src = | false | null | false | (mk_ins (make_instr (I.ins_AddCarry64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_AddCarry64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Adc64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 50,
"end_line": 195,
"start_col": 2,
"start_line": 195
} |
Prims.Tot | val va_codegen_success_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ()) | val va_codegen_success_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adc64Wrap dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Adc64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 199,
"start_col": 2,
"start_line": 199
} |
Prims.Tot | val va_code_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src)) | val va_code_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adcx64Wrap dst src = | false | null | false | (mk_ins (make_instr (I.ins_Adcx64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Adcx64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"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": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Adcx64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 46,
"end_line": 226,
"start_col": 2,
"start_line": 226
} |
Prims.Tot | val va_codegen_success_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ()) | val va_codegen_success_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adcx64Wrap dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"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": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Adcx64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 230,
"start_col": 2,
"start_line": 230
} |
Prims.Ghost | val va_wpProof_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Add64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Add64",
"Vale.X64.InsBasic.va_code_Add64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Add64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Add64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 99,
"start_col": 41,
"start_line": 92
} |
Prims.Ghost | val va_wpProof_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adc64Wrap dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Adc64Wrap",
"Vale.X64.InsBasic.va_code_Adc64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Adc64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Adc64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 218,
"start_col": 45,
"start_line": 211
} |
Prims.Ghost | val va_wpProof_Cpuid_Sse : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sse va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sse ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Sse : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sse va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sse ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Sse va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Sse",
"Vale.X64.InsBasic.va_code_Cpuid_Sse"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Sse : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sse va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sse ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Sse | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 794,
"start_col": 37,
"start_line": 786
} |
Prims.Ghost | val va_wpProof_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sub64Wrap dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Sub64Wrap",
"Vale.X64.InsBasic.va_code_Sub64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Sub64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 344,
"start_col": 45,
"start_line": 337
} |
Prims.Ghost | val va_wpProof_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sbb64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sbb64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sbb64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sbb64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sbb64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Sbb64",
"Vale.X64.InsBasic.va_code_Sbb64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sbb64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sbb64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Sbb64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 374,
"start_col": 41,
"start_line": 367
} |
Prims.Ghost | val va_wpProof_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Xor64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Xor64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Xor64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Xor64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Xor64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Xor64",
"Vale.X64.InsBasic.va_code_Xor64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Xor64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Xor64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Xor64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 512,
"start_col": 41,
"start_line": 505
} |
Prims.Ghost | val va_wpProof_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mulx64 dst_hi dst_lo src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mulx64 dst_hi dst_lo src)
([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mulx64 dst_hi dst_lo src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mulx64 dst_hi dst_lo src)
([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_ok va_sM
(va_update_operand_dst_opr64 dst_lo va_sM (va_update_operand_dst_opr64 dst_hi va_sM va_s0)
)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Mulx64",
"Vale.X64.InsBasic.va_code_Mulx64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mulx64 dst_hi dst_lo src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mulx64 dst_hi dst_lo src)
([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Mulx64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst_hi: Vale.X64.Decls.va_operand_dst_opr64 ->
dst_lo: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 445,
"start_col": 52,
"start_line": 438
} |
Prims.Ghost | val va_wpProof_Cpuid_Adx_Bmi2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Adx_Bmi2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Adx_Bmi2 ()) ([va_Mod_reg64
rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0,
va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Adx_Bmi2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Adx_Bmi2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Adx_Bmi2 ()) ([va_Mod_reg64
rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0,
va_g))))
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Adx_Bmi2",
"Vale.X64.InsBasic.va_code_Cpuid_Adx_Bmi2"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Adx_Bmi2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Adx_Bmi2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Adx_Bmi2 ()) ([va_Mod_reg64
rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0,
va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Adx_Bmi2 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 698,
"start_col": 42,
"start_line": 690
} |
Prims.Ghost | val va_wpProof_Cpuid_Movbe : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Movbe va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Movbe ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Movbe : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Movbe va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Movbe ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Movbe va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Movbe",
"Vale.X64.InsBasic.va_code_Cpuid_Movbe"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Movbe : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Movbe va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Movbe ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Movbe | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 826,
"start_col": 39,
"start_line": 818
} |
Prims.Ghost | val va_wpProof_Cpuid_Sha : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sha va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sha ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Sha : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sha va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sha ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Sha va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Sha",
"Vale.X64.InsBasic.va_code_Cpuid_Sha"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Sha : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Sha va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Sha ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Sha | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 666,
"start_col": 37,
"start_line": 658
} |
Prims.Ghost | val va_wpProof_Cpuid_AES : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_AES va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_AES ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_AES : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_AES va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_AES ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_AES va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_AES",
"Vale.X64.InsBasic.va_code_Cpuid_AES"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_AES : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_AES va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_AES ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_AES | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 634,
"start_col": 37,
"start_line": 626
} |
Prims.Ghost | val va_wpProof_NoNewline : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_NoNewline va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_NoNewline ()) ([]) va_s0 va_k ((va_sM,
va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_NoNewline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_NoNewline (va_code_NoNewline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_NoNewline : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_NoNewline va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_NoNewline ()) ([]) va_s0 va_k ((va_sM,
va_f0, va_g))))
let va_wpProof_NoNewline va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_NoNewline (va_code_NoNewline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Nil",
"Vale.X64.QuickCode.mod_t",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_NoNewline",
"Vale.X64.InsBasic.va_code_NoNewline"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"]
let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0)))
[@ "opaque_to_smt"]
let va_codegen_success_NoNewline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_NoNewline va_b0 va_s0 =
va_reveal_opaque (`%va_code_NoNewline) (va_code_NoNewline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace
0))) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_NoNewline : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_NoNewline va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_NoNewline ()) ([]) va_s0 va_k ((va_sM,
va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_NoNewline | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 1124,
"start_col": 37,
"start_line": 1118
} |
Prims.Ghost | val va_wpProof_Cpuid_Rdrand : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Rdrand va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Rdrand ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Rdrand : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Rdrand va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Rdrand ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Rdrand va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Rdrand",
"Vale.X64.InsBasic.va_code_Cpuid_Rdrand"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Rdrand : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Rdrand va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Rdrand ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Rdrand | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 858,
"start_col": 40,
"start_line": 850
} |
Prims.Ghost | val va_wpProof_Cpuid_Avx2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx2 ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Avx2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx2 ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Avx2 va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Avx2",
"Vale.X64.InsBasic.va_code_Cpuid_Avx2"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Avx2 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx2 ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Avx2 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 762,
"start_col": 38,
"start_line": 754
} |
Prims.Ghost | val va_wpProof_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> va_s0:va_state
-> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Nat64Equal dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Nat64Equal dst src) ([va_Mod_flags;
va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> va_s0:va_state
-> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Nat64Equal dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Nat64Equal dst src) ([va_Mod_flags;
va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Nat64Equal dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM
(va_update_ok va_sM
(va_update_operand_reg_opr64 src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))
));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_reg_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_reg_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_reg_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Nat64Equal",
"Vale.X64.InsBasic.va_code_Nat64Equal"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> va_s0:va_state
-> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Nat64Equal dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Nat64Equal dst src) ([va_Mod_flags;
va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Nat64Equal | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_reg_opr64 ->
src: Vale.X64.Decls.va_operand_reg_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 1033,
"start_col": 46,
"start_line": 1026
} |
Prims.Ghost | val va_lemma_Prefetchnta : va_b0:va_code -> va_s0:va_state -> v:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Prefetchnta v) va_s0 /\ va_is_src_opr64 v va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_state_eq va_sM (va_update_ok va_sM va_s0))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Prefetchnta va_b0 va_s0 v =
va_reveal_opaque (`%va_code_Prefetchnta) (va_code_Prefetchnta v);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Prefetchnta) (S.AnnotatePrefetchnta ()) v))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Prefetchnta)
(S.AnnotatePrefetchnta ()) v)) va_s0 in
(va_sM, va_fM) | val va_lemma_Prefetchnta : va_b0:va_code -> va_s0:va_state -> v:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Prefetchnta v) va_s0 /\ va_is_src_opr64 v va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_state_eq va_sM (va_update_ok va_sM va_s0)))
let va_lemma_Prefetchnta va_b0 va_s0 v = | false | null | false | va_reveal_opaque (`%va_code_Prefetchnta) (va_code_Prefetchnta v);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Prefetchnta) (S.AnnotatePrefetchnta ()) v)) va_s0;
let va_sM, va_fM =
va_eval_ins (mk_ins (make_instr_annotate (I.ins_Prefetchnta) (S.AnnotatePrefetchnta ()) v)) va_s0
in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_out",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.op64",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Prefetchnta",
"Vale.X64.Machine_Semantics_s.AnnotatePrefetchnta",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Prefetchnta"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"]
let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0)))
[@ "opaque_to_smt"]
let va_codegen_success_NoNewline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_NoNewline va_b0 va_s0 =
va_reveal_opaque (`%va_code_NoNewline) (va_code_NoNewline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace
0))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_NoNewline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_NoNewline (va_code_NoNewline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Newline
[@ "opaque_to_smt"]
let va_code_Newline () =
(mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ())))
[@ "opaque_to_smt"]
let va_codegen_success_Newline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Newline va_b0 va_s0 =
va_reveal_opaque (`%va_code_Newline) (va_code_Newline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ()))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline
()))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Newline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Newline (va_code_Newline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Space
[@ "opaque_to_smt"]
let va_code_Space n =
(mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace n)))
[@ "opaque_to_smt"]
let va_codegen_success_Space n =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Space va_b0 va_s0 n =
va_reveal_opaque (`%va_code_Space) (va_code_Space n);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace n))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace
n))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Space n va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Space (va_code_Space n) va_s0 n in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Prefetchnta
[@ "opaque_to_smt"]
let va_code_Prefetchnta v =
(mk_ins (make_instr_annotate (I.ins_Prefetchnta) (S.AnnotatePrefetchnta ()) v))
[@ "opaque_to_smt"]
let va_codegen_success_Prefetchnta v =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Prefetchnta : va_b0:va_code -> va_s0:va_state -> v:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Prefetchnta v) va_s0 /\ va_is_src_opr64 v va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_state_eq va_sM (va_update_ok va_sM va_s0))) | [] | Vale.X64.InsBasic.va_lemma_Prefetchnta | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
v: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 1205,
"start_col": 2,
"start_line": 1199
} |
Prims.Tot | val va_code_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src)) | val va_code_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Adox64Wrap dst src = | false | null | false | (mk_ins (make_instr (I.ins_Adox64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsOf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Adox64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Adox64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 46,
"end_line": 261,
"start_col": 2,
"start_line": 261
} |
Prims.Tot | val va_codegen_success_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ()) | val va_codegen_success_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Adox64Wrap dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Adox64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 265,
"start_col": 2,
"start_line": 265
} |
Prims.Tot | val va_codegen_success_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Sub64 dst src =
(va_ttrue ()) | val va_codegen_success_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sub64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Sub64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 295,
"start_col": 2,
"start_line": 295
} |
Prims.Ghost | val va_lemma_Cpuid_AES : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_AES ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 33554432 > 0 == aesni_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 2 > 0 == pclmulqdq_enabled /\ va_state_eq
va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | val va_lemma_Cpuid_AES : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_AES ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 33554432 > 0 == aesni_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 2 > 0 == pclmulqdq_enabled /\ va_state_eq
va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
let va_lemma_Cpuid_AES va_b0 va_s0 = | false | null | false | va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Vale.X64.CPU_Features_s.cpuid_features",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Cpuid_AES"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Cpuid_AES : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_AES ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 33554432 > 0 == aesni_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 2 > 0 == pclmulqdq_enabled /\ va_state_eq
va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [] | Vale.X64.InsBasic.va_lemma_Cpuid_AES | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 622,
"start_col": 2,
"start_line": 617
} |
Prims.Ghost | val va_lemma_Cpuid_Avx512 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx512 ()) va_s0 /\ va_get_ok va_s0 /\
va_get_reg64 rRax va_s0 = 7 /\ va_get_reg64 rRcx va_s0 = 0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 65536 > 0 == avx512f_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 131072 > 0 == avx512dq_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 1073741824 > 0 == avx512bw_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 2147483648 > 0 == avx512vl_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | val va_lemma_Cpuid_Avx512 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx512 ()) va_s0 /\ va_get_ok va_s0 /\
va_get_reg64 rRax va_s0 = 7 /\ va_get_reg64 rRcx va_s0 = 0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 65536 > 0 == avx512f_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 131072 > 0 == avx512dq_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 1073741824 > 0 == avx512bw_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 2147483648 > 0 == avx512vl_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
let va_lemma_Cpuid_Avx512 va_b0 va_s0 = | false | null | false | va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Vale.X64.CPU_Features_s.cpuid_features",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Cpuid_Avx512"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Cpuid_Avx512 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx512 ()) va_s0 /\ va_get_ok va_s0 /\
va_get_reg64 rRax va_s0 = 7 /\ va_get_reg64 rRcx va_s0 = 0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 65536 > 0 == avx512f_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 131072 > 0 == avx512dq_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 1073741824 > 0 == avx512bw_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRbx va_sM) 2147483648 > 0 == avx512vl_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [] | Vale.X64.InsBasic.va_lemma_Cpuid_Avx512 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 878,
"start_col": 2,
"start_line": 873
} |
Prims.Tot | val va_code_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src)) | val va_code_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Sub64Wrap dst src = | false | null | false | (mk_ins (make_instr (I.ins_Sub64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Sub64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Sub64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 45,
"end_line": 321,
"start_col": 2,
"start_line": 321
} |
Prims.Ghost | val va_lemma_Cpuid_Sse : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Sse ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRdx va_sM) 67108864 > 0 == sse2_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 524288 > 0 == sse4_1_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 512 > 0 == ssse3_enabled /\ va_state_eq va_sM
(va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | val va_lemma_Cpuid_Sse : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Sse ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRdx va_sM) 67108864 > 0 == sse2_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 524288 > 0 == sse4_1_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 512 > 0 == ssse3_enabled /\ va_state_eq va_sM
(va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
let va_lemma_Cpuid_Sse va_b0 va_s0 = | false | null | false | va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Vale.X64.CPU_Features_s.cpuid_features",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Cpuid_Sse"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Cpuid_Sse : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Sse ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRdx va_sM) 67108864 > 0 == sse2_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 524288 > 0 == sse4_1_enabled /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 512 > 0 == ssse3_enabled /\ va_state_eq va_sM
(va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM
(va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [] | Vale.X64.InsBasic.va_lemma_Cpuid_Sse | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 782,
"start_col": 2,
"start_line": 777
} |
Prims.Tot | val va_codegen_success_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Sbb64 dst src =
(va_ttrue ()) | val va_codegen_success_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sbb64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Sbb64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 355,
"start_col": 2,
"start_line": 355
} |
Prims.Tot | val va_code_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src)) | val va_code_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Sbb64 dst src = | false | null | false | (mk_ins (make_instr (I.ins_Sbb64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Sbb64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Sbb64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Sbb64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 45,
"end_line": 351,
"start_col": 2,
"start_line": 351
} |
Prims.Tot | val va_codegen_success_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ()) | val va_codegen_success_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Sub64Wrap dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Sub64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Sub64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 325,
"start_col": 2,
"start_line": 325
} |
Prims.Ghost | val va_lemma_Cpuid_Avx : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 268435456 > 0 == avx_cpuid_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | val va_lemma_Cpuid_Avx : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 268435456 > 0 == avx_cpuid_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))
let va_lemma_Cpuid_Avx va_b0 va_s0 = | false | null | false | va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Vale.X64.CPU_Features_s.cpuid_features",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Cpuid_Avx"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Cpuid_Avx : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cpuid_Avx ()) va_s0 /\ va_get_ok va_s0 /\ va_get_reg64
rRax va_s0 = 1))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
Vale.Arch.Types.iand64 (va_get_reg64 rRcx va_sM) 268435456 > 0 == avx_cpuid_enabled /\
va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx
va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))) | [] | Vale.X64.InsBasic.va_lemma_Cpuid_Avx | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 718,
"start_col": 2,
"start_line": 713
} |
Prims.Ghost | val va_lemma_Shl64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shl64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishl64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM) | val va_lemma_Shl64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shl64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishl64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Shl64 va_b0 va_s0 dst amt = | false | null | false | va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Shl64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Shl64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Shl64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shl64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishl64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Shl64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
amt: Vale.X64.Decls.va_operand_shift_amt64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 561,
"start_col": 2,
"start_line": 557
} |
Prims.Ghost | val va_wpProof_Mov64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mov64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mov64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Mov64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mov64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mov64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mov64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Mov64",
"Vale.X64.InsBasic.va_code_Mov64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Mov64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mov64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mov64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Mov64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 40,
"start_col": 41,
"start_line": 34
} |
Prims.Ghost | val va_lemma_Adc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst + 1 < pow2_64 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf
(va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Adc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst + 1 < pow2_64 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf
(va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adc64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_AddCarry64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Adc64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Adc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst + 1 < pow2_64 /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf
(va_get_flags va_sM) (va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if
Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Adc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 177,
"start_col": 2,
"start_line": 173
} |
Prims.Ghost | val va_wpProof_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cmovc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cmovc64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cmovc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cmovc64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cmovc64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cmovc64",
"Vale.X64.InsBasic.va_code_Cmovc64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cmovc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cmovc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cmovc64 dst src) ([va_mod_dst_opr64
dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cmovc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 69,
"start_col": 43,
"start_line": 63
} |
Prims.Ghost | val va_wpProof_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Add64Wrap dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Add64Wrap",
"Vale.X64.InsBasic.va_code_Add64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Add64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Add64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Add64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Add64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 129,
"start_col": 45,
"start_line": 122
} |
Prims.Ghost | val va_wpProof_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_AddLea64 dst src1 src2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AddLea64 dst src1 src2)
([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_AddLea64 dst src1 src2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AddLea64 dst src1 src2)
([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_AddLea64",
"Vale.X64.InsBasic.va_code_AddLea64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_AddLea64 : dst:va_operand_dst_opr64 -> src1:va_operand_opr64 ->
src2:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_AddLea64 dst src1 src2 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_AddLea64 dst src1 src2)
([va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_AddLea64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src1: Vale.X64.Decls.va_operand_opr64 ->
src2: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 158,
"start_col": 50,
"start_line": 152
} |
Prims.Ghost | val va_lemma_Cmovc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cmovc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (if
Vale.X64.Decls.cf (va_get_flags va_sM) then (va_eval_dst_opr64 va_sM dst = va_eval_opr64 va_s0
src) else (va_eval_dst_opr64 va_sM dst = va_eval_dst_opr64 va_s0 dst)) /\ va_state_eq va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Cmovc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cmovc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (if
Vale.X64.Decls.cf (va_get_flags va_sM) then (va_eval_dst_opr64 va_sM dst = va_eval_opr64 va_s0
src) else (va_eval_dst_opr64 va_sM dst = va_eval_dst_opr64 va_s0 dst)) /\ va_state_eq va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_Cmovc64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cmovc64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Cmovc64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Cmovc64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Cmovc64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (if
Vale.X64.Decls.cf (va_get_flags va_sM) then (va_eval_dst_opr64 va_sM dst = va_eval_opr64 va_s0
src) else (va_eval_dst_opr64 va_sM dst = va_eval_dst_opr64 va_s0 dst)) /\ va_state_eq va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))) | [] | Vale.X64.InsBasic.va_lemma_Cmovc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 59,
"start_col": 2,
"start_line": 55
} |
Prims.Ghost | val va_lemma_Shr64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shr64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishr64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM) | val va_lemma_Shr64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shr64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishr64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Shr64 va_b0 va_s0 dst amt = | false | null | false | va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Shr64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Shr64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Shr64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
amt:va_operand_shift_amt64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Shr64 dst amt) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_shift_amt64 amt va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.ishr64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_shift_amt64 va_s0 amt) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Shr64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
amt: Vale.X64.Decls.va_operand_shift_amt64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 591,
"start_col": 2,
"start_line": 587
} |
Prims.Ghost | val va_wpProof_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adc64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Adc64",
"Vale.X64.InsBasic.va_code_Adc64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Adc64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adc64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adc64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Adc64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 188,
"start_col": 41,
"start_line": 181
} |
Prims.Ghost | val va_lemma_And64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_And64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.iand64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_And64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_And64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.iand64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_And64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_And64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_And64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_And64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_And64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.iand64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_And64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 531,
"start_col": 2,
"start_line": 527
} |
Prims.Tot | val va_codegen_success_Mul64Wrap : src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Mul64Wrap src =
(va_ttrue ()) | val va_codegen_success_Mul64Wrap : src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Mul64Wrap src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Mul64Wrap : src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Mul64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 394,
"start_col": 2,
"start_line": 394
} |
Prims.Tot | val va_code_Mul64Wrap : src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src)) | val va_code_Mul64Wrap : src:va_operand_opr64 -> Tot va_code
let va_code_Mul64Wrap src = | false | null | false | (mk_ins (make_instr (I.ins_Mul64) src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.op64",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Mul64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Mul64Wrap : src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Mul64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | src: Vale.X64.Decls.va_operand_opr64 -> Vale.X64.Decls.va_code | {
"end_col": 41,
"end_line": 390,
"start_col": 2,
"start_line": 390
} |
Prims.Tot | val va_code_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src)) | val va_code_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_IMul64 dst src = | false | null | false | (mk_ins (make_instr (I.ins_IMul64) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_IMul64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_IMul64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 46,
"end_line": 456,
"start_col": 2,
"start_line": 456
} |
Prims.Tot | val va_code_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) | val va_code_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> Tot va_code
let va_code_Mulx64 dst_hi dst_lo src = | false | null | false | (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Mulx64",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Mulx64 : dst_hi:va_operand_dst_opr64 -> dst_lo:va_operand_dst_opr64 ->
src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Mulx64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst_hi: Vale.X64.Decls.va_operand_dst_opr64 ->
dst_lo: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 56,
"end_line": 421,
"start_col": 2,
"start_line": 421
} |
Prims.Tot | val va_codegen_success_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_IMul64 dst src =
(va_ttrue ()) | val va_codegen_success_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_IMul64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_IMul64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 460,
"start_col": 2,
"start_line": 460
} |
Prims.Tot | val va_code_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) | val va_code_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code
let va_code_Xor64 dst src = | false | null | false | (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.opFlagsOf",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Xor64",
"Vale.X64.Machine_Semantics_s.AnnotateXor64",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Xor64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_code | {
"end_col": 75,
"end_line": 488,
"start_col": 2,
"start_line": 488
} |
Prims.Tot | val va_codegen_success_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Xor64 dst src =
(va_ttrue ()) | val va_codegen_success_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool
let va_codegen_success_Xor64 dst src = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Xor64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Xor64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> src: Vale.X64.Decls.va_operand_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 492,
"start_col": 2,
"start_line": 492
} |
Prims.Ghost | val va_lemma_Sub64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.sub_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst - va_eval_opr64 va_s0 src < 0) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Sub64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.sub_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst - va_eval_opr64 va_s0 src < 0) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Sub64Wrap va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Sub64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Sub64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Sub64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.sub_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst - va_eval_opr64 va_s0 src < 0) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Sub64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 333,
"start_col": 2,
"start_line": 329
} |
Prims.Tot | val va_codegen_success_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Shl64 dst amt =
(va_ttrue ()) | val va_codegen_success_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool
let va_codegen_success_Shl64 dst amt = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Shl64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 553,
"start_col": 2,
"start_line": 553
} |
Prims.Tot | val va_codegen_success_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Shr64 dst amt =
(va_ttrue ()) | val va_codegen_success_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool
let va_codegen_success_Shr64 dst amt = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> Tot
va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Shr64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_dst_opr64 -> amt: Vale.X64.Decls.va_operand_shift_amt64
-> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 583,
"start_col": 2,
"start_line": 583
} |
Prims.Ghost | val va_lemma_Adcx64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adcx64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_cf
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ Vale.X64.Decls.maintained_of (va_get_flags va_sM) (va_get_flags va_s0) /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM) | val va_lemma_Adcx64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adcx64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_cf
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ Vale.X64.Decls.maintained_of (va_get_flags va_sM) (va_get_flags va_s0) /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0)))))
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src))
(if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src +
(if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0))
`op_Modulus`
pow2_64);
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Vale.Arch.Types.add_wrap64",
"Vale.X64.Decls.va_eval_dst_opr64",
"Vale.X64.Decls.va_eval_opr64",
"Vale.X64.Decls.cf",
"Vale.X64.Decls.va_get_flags",
"Prims.bool",
"Vale.Def.Words_s.nat64",
"Prims.op_Modulus",
"Prims.op_Addition",
"Vale.X64.Machine_s.pow2_64",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Adcx64",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Adcx64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"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": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Adcx64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adcx64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_cf
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ Vale.X64.Decls.maintained_of (va_get_flags va_sM) (va_get_flags va_s0) /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Adcx64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 242,
"start_col": 2,
"start_line": 234
} |
Prims.Tot | val va_code_Cpuid_AES : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_AES : va_dummy:unit -> Tot va_code
let va_code_Cpuid_AES () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_AES : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_AES | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 609,
"start_col": 2,
"start_line": 609
} |
Prims.Tot | val va_codegen_success_Cpuid_AES : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_AES () =
(va_ttrue ()) | val va_codegen_success_Cpuid_AES : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_AES () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_AES : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_AES | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 613,
"start_col": 2,
"start_line": 613
} |
Prims.Tot | val va_code_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Adx_Bmi2 () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_Adx_Bmi2 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 673,
"start_col": 2,
"start_line": 673
} |
Prims.Tot | val va_code_Cpuid_Avx : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_Avx : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Avx () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_Avx : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_Avx | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 705,
"start_col": 2,
"start_line": 705
} |
Prims.Ghost | val va_lemma_Mov64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mov64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Mov64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mov64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_Mov64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let va_sM, va_fM =
va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0
in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Mov64",
"Vale.X64.Machine_Semantics_s.AnnotateMov64",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Mov64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Mov64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mov64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))) | [] | Vale.X64.InsBasic.va_lemma_Mov64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 30,
"start_col": 2,
"start_line": 25
} |
Prims.Tot | val va_codegen_success_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Adx_Bmi2 () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Adx_Bmi2 : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Adx_Bmi2 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 677,
"start_col": 2,
"start_line": 677
} |
Prims.Ghost | val va_lemma_Add64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst < pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Add64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst < pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0)))))
let va_lemma_Add64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Add64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Add64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Add64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ va_eval_opr64 va_s0 src + va_eval_dst_opr64
va_s0 dst < pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Add64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 88,
"start_col": 2,
"start_line": 84
} |
Prims.Ghost | val va_wpProof_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adcx64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adcx64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adcx64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adcx64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adcx64Wrap dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Adcx64Wrap",
"Vale.X64.InsBasic.va_code_Adcx64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"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": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Adcx64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adcx64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adcx64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Adcx64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 253,
"start_col": 46,
"start_line": 246
} |
Prims.Ghost | val va_lemma_AddLea64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src1:va_operand_opr64 -> src2:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_AddLea64 dst src1 src2) va_s0 /\ va_is_dst_dst_opr64
dst va_s0 /\ va_is_src_opr64 src1 va_s0 /\ va_is_src_opr64 src2 va_s0 /\ va_get_ok va_s0 /\
Vale.X64.Decls.max_one_mem src1 src2 /\ va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 <
pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM) | val va_lemma_AddLea64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src1:va_operand_opr64 -> src2:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_AddLea64 dst src1 src2) va_s0 /\ va_is_dst_dst_opr64
dst va_s0 /\ va_is_src_opr64 src1 va_s0 /\ va_is_src_opr64 src2 va_s0 /\ va_get_ok va_s0 /\
Vale.X64.Decls.max_one_mem src1 src2 /\ va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 <
pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 = | false | null | false | va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_AddLea64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_AddLea64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_AddLea64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src1:va_operand_opr64 -> src2:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_AddLea64 dst src1 src2) va_s0 /\ va_is_dst_dst_opr64
dst va_s0 /\ va_is_src_opr64 src1 va_s0 /\ va_is_src_opr64 src2 va_s0 /\ va_get_ok va_s0 /\
Vale.X64.Decls.max_one_mem src1 src2 /\ va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 <
pow2_64))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_opr64 va_s0 src1 + va_eval_opr64 va_s0 src2 /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))) | [] | Vale.X64.InsBasic.va_lemma_AddLea64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src1: Vale.X64.Decls.va_operand_opr64 ->
src2: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 148,
"start_col": 2,
"start_line": 144
} |
Prims.Tot | val va_code_Cpuid_Avx2 : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_Avx2 : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Avx2 () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_Avx2 : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_Avx2 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 737,
"start_col": 2,
"start_line": 737
} |
Prims.Tot | val va_code_Cpuid_Sse : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_Sse : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Sse () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_Sse : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_Sse | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 769,
"start_col": 2,
"start_line": 769
} |
Prims.Tot | val va_codegen_success_Cpuid_Sse : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Sse () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Sse : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Sse () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Sse : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Sse | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 773,
"start_col": 2,
"start_line": 773
} |
Prims.Tot | val va_codegen_success_Cpuid_Movbe : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Movbe : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Movbe () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Movbe : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Movbe | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 805,
"start_col": 2,
"start_line": 805
} |
Prims.Ghost | val va_wpProof_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adox64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adox64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adox64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adox64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Adox64Wrap dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Adox64Wrap",
"Vale.X64.InsBasic.va_code_Adox64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Adox64Wrap : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Adox64Wrap dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Adox64Wrap dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Adox64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 284,
"start_col": 46,
"start_line": 277
} |
Prims.Ghost | val va_wpProof_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Sub64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Sub64",
"Vale.X64.InsBasic.va_code_Sub64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Sub64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Sub64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Sub64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Sub64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 314,
"start_col": 41,
"start_line": 307
} |
Prims.Tot | val va_code_Cpuid_Rdrand : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid))) | val va_code_Cpuid_Rdrand : va_dummy:unit -> Tot va_code
let va_code_Cpuid_Rdrand () = | false | null | false | (mk_ins (make_instr (I.ins_Cpuid))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Instruction_s.out",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRdx",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Cpuid",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Cpuid_Rdrand : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Cpuid_Rdrand | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 37,
"end_line": 833,
"start_col": 2,
"start_line": 833
} |
Prims.Tot | val va_codegen_success_Cpuid_Rdrand : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Rdrand : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Rdrand () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Rdrand : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Rdrand | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 837,
"start_col": 2,
"start_line": 837
} |
Prims.Tot | val va_codegen_success_Cpuid_Avx512 : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Avx512 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Avx512 () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Avx512 : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Avx512 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 869,
"start_col": 2,
"start_line": 869
} |
Prims.Tot | val va_codegen_success_Cpuid_Osxsave : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ()) | val va_codegen_success_Cpuid_Osxsave : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Cpuid_Osxsave () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Cpuid_Osxsave : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Cpuid_Osxsave | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 901,
"start_col": 2,
"start_line": 901
} |
Prims.Ghost | val va_lemma_Add64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Add64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Add64Wrap va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Add64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Add64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Add64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Add64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_s0 dst)
(va_eval_opr64 va_s0 src) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src >= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM
(va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Add64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 118,
"start_col": 2,
"start_line": 114
} |
Prims.Tot | val va_codegen_success_Xgetbv_Avx : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ()) | val va_codegen_success_Xgetbv_Avx : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Xgetbv_Avx () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Xgetbv_Avx : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 933,
"start_col": 2,
"start_line": 933
} |
Prims.Tot | val va_codegen_success_Xgetbv_Avx512 : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ()) | val va_codegen_success_Xgetbv_Avx512 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Xgetbv_Avx512 () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Xgetbv_Avx512 : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Xgetbv_Avx512 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 964,
"start_col": 2,
"start_line": 964
} |
Prims.Ghost | val va_wpProof_Mul64Wrap : src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mul64Wrap src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mul64Wrap src) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRax; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Mul64Wrap : src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mul64Wrap src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mul64Wrap src) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRax; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Mul64Wrap src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRax",
"Vale.X64.QuickCode.va_Mod_flags",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Mul64Wrap",
"Vale.X64.InsBasic.va_code_Mul64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Mul64Wrap : src:va_operand_opr64 -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Mul64Wrap src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Mul64Wrap src) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRax; va_Mod_flags]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Mul64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 414,
"start_col": 41,
"start_line": 407
} |
Prims.Ghost | val va_lemma_Adc64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Adc64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adc64Wrap va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_AddCarry64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Adc64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Adc64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adc64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.valid_cf (va_get_flags
va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.cf (va_get_flags
va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_cf (va_get_flags va_sM) (va_eval_dst_opr64
va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0)
>= pow2_64) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Adc64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 207,
"start_col": 2,
"start_line": 203
} |
Prims.Tot | val va_codegen_success_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot
va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
())))) | val va_codegen_success_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot
va_pbool
let va_codegen_success_Nat64Equal dst src = | false | null | false | (va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615))
(va_pbool_and (va_codegen_success_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0))
(va_pbool_and (va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0))
(va_ttrue ())))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Vale.X64.Decls.va_operand_reg_opr64",
"Vale.X64.Decls.va_pbool_and",
"Vale.X64.InsBasic.va_codegen_success_Sub64Wrap",
"Vale.X64.Decls.va_coerce_reg_opr64_to_dst_opr64",
"Vale.X64.Decls.va_const_opr64",
"Vale.X64.InsBasic.va_codegen_success_Mov64",
"Vale.X64.InsBasic.va_codegen_success_Adc64",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Nat64Equal : dst:va_operand_reg_opr64 -> src:va_operand_reg_opr64 -> Tot
va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Nat64Equal | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | dst: Vale.X64.Decls.va_operand_reg_opr64 -> src: Vale.X64.Decls.va_operand_reg_opr64
-> Vale.X64.Decls.va_pbool | {
"end_col": 10,
"end_line": 1002,
"start_col": 2,
"start_line": 998
} |
Prims.Ghost | val va_wpProof_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_IMul64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_IMul64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_IMul64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_IMul64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_IMul64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_IMul64",
"Vale.X64.InsBasic.va_code_IMul64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_IMul64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_IMul64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_IMul64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_IMul64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 481,
"start_col": 42,
"start_line": 474
} |
Prims.Tot | val va_codegen_success_Comment : c:string -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Comment c =
(va_ttrue ()) | val va_codegen_success_Comment : c:string -> Tot va_pbool
let va_codegen_success_Comment c = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.string",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Comment : c:string -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Comment | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | c: Prims.string -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 1044,
"start_col": 2,
"start_line": 1044
} |
Prims.Ghost | val va_lemma_Sub64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ 0 <= va_eval_dst_opr64 va_s0 dst -
va_eval_opr64 va_s0 src))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Sub64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ 0 <= va_eval_dst_opr64 va_s0 dst -
va_eval_opr64 va_s0 src))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0)))))
let va_lemma_Sub64 va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.opFlagsCf",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Sub64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Sub64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Sub64 : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Sub64 dst src) va_s0 /\ va_is_dst_dst_opr64 dst va_s0
/\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ 0 <= va_eval_dst_opr64 va_s0 dst -
va_eval_opr64 va_s0 src))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == va_eval_dst_opr64 va_s0 dst - va_eval_opr64 va_s0 src /\
va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst
va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Sub64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 303,
"start_col": 2,
"start_line": 299
} |
Prims.Tot | val va_code_LargeComment : c:string -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c))) | val va_code_LargeComment : c:string -> Tot va_code
let va_code_LargeComment c = | false | null | false | (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.string",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_LargeComment",
"Vale.X64.Machine_Semantics_s.AnnotateLargeComment",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_LargeComment : c:string -> Tot va_code | [] | Vale.X64.InsBasic.va_code_LargeComment | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | c: Prims.string -> Vale.X64.Decls.va_code | {
"end_col": 82,
"end_line": 1070,
"start_col": 2,
"start_line": 1070
} |
Prims.Tot | val va_codegen_success_LargeComment : c:string -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_LargeComment c =
(va_ttrue ()) | val va_codegen_success_LargeComment : c:string -> Tot va_pbool
let va_codegen_success_LargeComment c = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.string",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_LargeComment : c:string -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_LargeComment | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | c: Prims.string -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 1074,
"start_col": 2,
"start_line": 1074
} |
Prims.Ghost | val va_wpProof_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_And64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_And64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_And64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_And64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_And64 dst src va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_And64",
"Vale.X64.InsBasic.va_code_And64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_And64 : dst:va_operand_dst_opr64 -> src:va_operand_opr64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_And64 dst src va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_And64 dst src) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_And64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 542,
"start_col": 41,
"start_line": 535
} |
Prims.Ghost | val va_wpProof_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shr64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shr64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shr64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shr64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Shr64 dst amt va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Shr64",
"Vale.X64.InsBasic.va_code_Shr64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Shr64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shr64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shr64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Shr64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
amt: Vale.X64.Decls.va_operand_shift_amt64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 602,
"start_col": 41,
"start_line": 595
} |
Prims.Ghost | val va_wpProof_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shl64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shl64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shl64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shl64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Shl64 dst amt va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_shift_amt64",
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_mod_dst_opr64",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_flags",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_update_operand_dst_opr64",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Shl64",
"Vale.X64.InsBasic.va_code_Shl64"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Shl64 : dst:va_operand_dst_opr64 -> amt:va_operand_shift_amt64 -> va_s0:va_state ->
va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Shl64 dst amt va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Shl64 dst amt) ([va_Mod_flags;
va_mod_dst_opr64 dst]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Shl64 | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
amt: Vale.X64.Decls.va_operand_shift_amt64 ->
va_s0: Vale.X64.Decls.va_state ->
va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 572,
"start_col": 41,
"start_line": 565
} |
Prims.Tot | val va_code_NoNewline : va_dummy:unit -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) | val va_code_NoNewline : va_dummy:unit -> Tot va_code
let va_code_NoNewline () = | false | null | false | (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Space",
"Vale.X64.Machine_Semantics_s.AnnotateSpace",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_NoNewline : va_dummy:unit -> Tot va_code | [] | Vale.X64.InsBasic.va_code_NoNewline | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_code | {
"end_col": 68,
"end_line": 1101,
"start_col": 2,
"start_line": 1101
} |
Prims.Ghost | val va_lemma_Mul64Wrap : va_b0:va_code -> va_s0:va_state -> src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mul64Wrap src) va_s0 /\ va_is_src_opr64 src va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_mul_nat pow2_64 (va_get_reg64 rRdx va_sM) + va_get_reg64 rRax va_sM == va_mul_nat
(va_get_reg64 rRax va_s0) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_reg64 rRdx
va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0)))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM) | val va_lemma_Mul64Wrap : va_b0:va_code -> va_s0:va_state -> src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mul64Wrap src) va_s0 /\ va_is_src_opr64 src va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_mul_nat pow2_64 (va_get_reg64 rRdx va_sM) + va_get_reg64 rRax va_sM == va_mul_nat
(va_get_reg64 rRax va_s0) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_reg64 rRdx
va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0))))))
let va_lemma_Mul64Wrap va_b0 va_s0 src = | false | null | false | va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Prims.unit",
"Vale.X64.InsBasic.lemma_fundamental_div_mod",
"Vale.X64.Decls.va_get_reg64",
"Vale.X64.Machine_s.rRax",
"Vale.X64.Decls.va_eval_opr64",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.out",
"Vale.X64.Instruction_s.one64Reg",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Instruction_s.inOut",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.op64",
"Vale.X64.Instruction_s.HavocFlags",
"Vale.X64.Instructions_s.ins_Mul64",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Mul64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Mul64Wrap : va_b0:va_code -> va_s0:va_state -> src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Mul64Wrap src) va_s0 /\ va_is_src_opr64 src va_s0 /\
va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_mul_nat pow2_64 (va_get_reg64 rRdx va_sM) + va_get_reg64 rRax va_sM == va_mul_nat
(va_get_reg64 rRax va_s0) (va_eval_opr64 va_s0 src) /\ va_state_eq va_sM (va_update_reg64 rRdx
va_sM (va_update_reg64 rRax va_sM (va_update_flags va_sM (va_update_ok va_sM va_s0)))))) | [] | Vale.X64.InsBasic.va_lemma_Mul64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 403,
"start_col": 2,
"start_line": 398
} |
Prims.Tot | val va_codegen_success_NoNewline : va_dummy:unit -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_NoNewline () =
(va_ttrue ()) | val va_codegen_success_NoNewline : va_dummy:unit -> Tot va_pbool
let va_codegen_success_NoNewline () = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.unit",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"]
let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_NoNewline : va_dummy:unit -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_NoNewline | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 1105,
"start_col": 2,
"start_line": 1105
} |
Prims.Ghost | val va_wpProof_Cpuid_Avx : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | val va_wpProof_Cpuid_Avx : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Cpuid_Avx va_s0 va_k = | false | null | false | let va_sM, va_f0 = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM
(va_update_reg64 rRdx
va_sM
(va_update_reg64 rRcx
va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))
);
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM
va_s0;
let va_g = () in
(va_sM, va_f0, va_g) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_state",
"Prims.unit",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.Mktuple3",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rRcx",
"Vale.X64.Machine_s.rRbx",
"Vale.X64.Machine_s.rRax",
"Prims.Nil",
"Prims._assert",
"Vale.X64.Decls.va_state_eq",
"Vale.X64.Decls.va_update_reg64",
"Vale.X64.Decls.va_update_ok",
"Vale.X64.Decls.va_lemma_upd_update",
"FStar.Pervasives.Native.tuple3",
"FStar.Pervasives.Native.tuple2",
"Vale.X64.State.vale_state",
"Vale.X64.InsBasic.va_lemma_Cpuid_Avx",
"Vale.X64.InsBasic.va_code_Cpuid_Avx"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM) | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wpProof_Cpuid_Avx : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Cpuid_Avx va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Cpuid_Avx ()) ([va_Mod_reg64 rRdx;
va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) | [] | Vale.X64.InsBasic.va_wpProof_Cpuid_Avx | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0)
-> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit) | {
"end_col": 22,
"end_line": 730,
"start_col": 37,
"start_line": 722
} |
Prims.Tot | val va_code_Space : n:nat -> Tot va_code | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_code_Space n =
(mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace n))) | val va_code_Space : n:nat -> Tot va_code
let va_code_Space n = | false | null | false | (mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace n))) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.nat",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr_annotate",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Space",
"Vale.X64.Machine_Semantics_s.AnnotateSpace",
"Vale.X64.Instruction_s.InstrTypeRecord",
"Vale.X64.Decls.va_code"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"]
let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0)))
[@ "opaque_to_smt"]
let va_codegen_success_NoNewline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_NoNewline va_b0 va_s0 =
va_reveal_opaque (`%va_code_NoNewline) (va_code_NoNewline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace
0))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_NoNewline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_NoNewline (va_code_NoNewline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Newline
[@ "opaque_to_smt"]
let va_code_Newline () =
(mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ())))
[@ "opaque_to_smt"]
let va_codegen_success_Newline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Newline va_b0 va_s0 =
va_reveal_opaque (`%va_code_Newline) (va_code_Newline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ()))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline
()))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Newline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Newline (va_code_Newline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Space
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_code_Space : n:nat -> Tot va_code | [] | Vale.X64.InsBasic.va_code_Space | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> Vale.X64.Decls.va_code | {
"end_col": 68,
"end_line": 1161,
"start_col": 2,
"start_line": 1161
} |
Prims.Tot | val va_codegen_success_Space : n:nat -> Tot va_pbool | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_codegen_success_Space n =
(va_ttrue ()) | val va_codegen_success_Space : n:nat -> Tot va_pbool
let va_codegen_success_Space n = | false | null | false | (va_ttrue ()) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [
"total"
] | [
"Prims.nat",
"Vale.X64.Decls.va_ttrue",
"Vale.X64.Decls.va_pbool"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adox64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adox64Wrap (va_code_Adox64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64
[@ "opaque_to_smt"]
let va_code_Sub64 dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64) (va_code_Sub64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64 (va_code_Sub64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sub64Wrap
[@ "opaque_to_smt"]
let va_code_Sub64Wrap dst src =
(mk_ins (make_instr (I.ins_Sub64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sub64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sub64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sub64Wrap) (va_code_Sub64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sub64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sub64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sub64Wrap (va_code_Sub64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Sbb64
[@ "opaque_to_smt"]
let va_code_Sbb64 dst src =
(mk_ins (make_instr (I.ins_Sbb64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Sbb64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Sbb64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Sbb64) (va_code_Sbb64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Sbb64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Sbb64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Sbb64 (va_code_Sbb64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
#restart-solver
#push-options "--max_fuel 0 --max_ifuel 0 --using_facts_from 'Prims FStar.UInt'"
let lemma_fundamental_div_mod (a b:nat64) :
Lemma (pow2_64 * (FStar.UInt.mul_div #64 a b) + (FStar.UInt.mul_mod #64 a b) == a * b)
=
FStar.Math.Lemmas.lemma_div_mod (a * b) pow2_64
#pop-options
//-- lemma_fundamental_div_mod
//--
//-- Mul64Wrap
[@ "opaque_to_smt"]
let va_code_Mul64Wrap src =
(mk_ins (make_instr (I.ins_Mul64) src))
[@ "opaque_to_smt"]
let va_codegen_success_Mul64Wrap src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mul64Wrap va_b0 va_s0 src =
va_reveal_opaque (`%va_code_Mul64Wrap) (va_code_Mul64Wrap src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mul64) src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mul64) src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRax va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mul64Wrap src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mul64Wrap (va_code_Mul64Wrap src) va_s0 src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM
(va_update_flags va_sM (va_update_ok va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_flags]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Mulx64
[@ "opaque_to_smt"]
let va_code_Mulx64 dst_hi dst_lo src =
(mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src))
[@ "opaque_to_smt"]
let va_codegen_success_Mulx64 dst_hi dst_lo src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mulx64 va_b0 va_s0 dst_hi dst_lo src =
va_reveal_opaque (`%va_code_Mulx64) (va_code_Mulx64 dst_hi dst_lo src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Mulx64) dst_hi dst_lo src)) va_s0 in
lemma_fundamental_div_mod (va_get_reg64 rRdx va_old_s) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mulx64 dst_hi dst_lo src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mulx64 (va_code_Mulx64 dst_hi dst_lo src) va_s0 dst_hi dst_lo src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst_lo va_sM
(va_update_operand_dst_opr64 dst_hi va_sM va_s0))));
va_lemma_norm_mods ([va_mod_dst_opr64 dst_lo; va_mod_dst_opr64 dst_hi]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- lemma_mul_nat
//--
//-- lemma_mul_in_bounds
//--
//-- IMul64
[@ "opaque_to_smt"]
let va_code_IMul64 dst src =
(mk_ins (make_instr (I.ins_IMul64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_IMul64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_IMul64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_IMul64) (va_code_IMul64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_IMul64) dst src)) va_s0 in
lemma_mul_nat (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
lemma_mul_in_bounds (va_eval_dst_opr64 va_old_s dst) (va_eval_opr64 va_old_s src);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_IMul64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_IMul64 (va_code_IMul64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xor64
[@ "opaque_to_smt"]
let va_code_Xor64 dst src =
(mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Xor64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xor64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Xor64) (va_code_Xor64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Xor64) (S.AnnotateXor64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xor64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xor64 (va_code_Xor64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- And64
[@ "opaque_to_smt"]
let va_code_And64 dst src =
(mk_ins (make_instr (I.ins_And64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_And64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_And64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_And64) (va_code_And64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_And64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_And64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_And64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_And64 (va_code_And64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shl64
[@ "opaque_to_smt"]
let va_code_Shl64 dst amt =
(mk_ins (make_instr (I.ins_Shl64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shl64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shl64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shl64) (va_code_Shl64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shl64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shl64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shl64 (va_code_Shl64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Shr64
[@ "opaque_to_smt"]
let va_code_Shr64 dst amt =
(mk_ins (make_instr (I.ins_Shr64) dst amt))
[@ "opaque_to_smt"]
let va_codegen_success_Shr64 dst amt =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Shr64 va_b0 va_s0 dst amt =
va_reveal_opaque (`%va_code_Shr64) (va_code_Shr64 dst amt);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Shr64) dst amt)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Shr64 dst amt va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Shr64 (va_code_Shr64 dst amt) va_s0 dst amt in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_AES
[@ "opaque_to_smt"]
let va_code_Cpuid_AES () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_AES () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_AES va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_AES) (va_code_Cpuid_AES ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_AES va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_AES (va_code_Cpuid_AES ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sha
[@ "opaque_to_smt"]
let va_code_Cpuid_Sha () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sha () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sha va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sha) (va_code_Cpuid_Sha ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sha va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sha (va_code_Cpuid_Sha ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Adx_Bmi2
[@ "opaque_to_smt"]
let va_code_Cpuid_Adx_Bmi2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Adx_Bmi2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Adx_Bmi2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Adx_Bmi2) (va_code_Cpuid_Adx_Bmi2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Adx_Bmi2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Adx_Bmi2 (va_code_Cpuid_Adx_Bmi2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx) (va_code_Cpuid_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx (va_code_Cpuid_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx2
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx2 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx2 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx2 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx2) (va_code_Cpuid_Avx2 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx2 (va_code_Cpuid_Avx2 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Sse
[@ "opaque_to_smt"]
let va_code_Cpuid_Sse () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Sse () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Sse va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Sse) (va_code_Cpuid_Sse ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Sse va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Sse (va_code_Cpuid_Sse ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Movbe
[@ "opaque_to_smt"]
let va_code_Cpuid_Movbe () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Movbe () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Movbe va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Movbe) (va_code_Cpuid_Movbe ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Movbe va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Movbe (va_code_Cpuid_Movbe ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Rdrand
[@ "opaque_to_smt"]
let va_code_Cpuid_Rdrand () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Rdrand () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Rdrand va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Rdrand) (va_code_Cpuid_Rdrand ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Rdrand va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Rdrand (va_code_Cpuid_Rdrand ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Avx512
[@ "opaque_to_smt"]
let va_code_Cpuid_Avx512 () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Avx512) (va_code_Cpuid_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Avx512 (va_code_Cpuid_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cpuid_Osxsave
[@ "opaque_to_smt"]
let va_code_Cpuid_Osxsave () =
(mk_ins (make_instr (I.ins_Cpuid)))
[@ "opaque_to_smt"]
let va_codegen_success_Cpuid_Osxsave () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cpuid_Osxsave va_b0 va_s0 =
va_reveal_opaque (`%va_code_Cpuid_Osxsave) (va_code_Cpuid_Osxsave ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cpuid))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cpuid))) va_s0 in
Vale.X64.CPU_Features_s.cpuid_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cpuid_Osxsave va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cpuid_Osxsave (va_code_Cpuid_Osxsave ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM
(va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax])
va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx) (va_code_Xgetbv_Avx ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx (va_code_Xgetbv_Avx ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Xgetbv_Avx512
[@ "opaque_to_smt"]
let va_code_Xgetbv_Avx512 () =
(mk_ins (make_instr (I.ins_Xgetbv)))
[@ "opaque_to_smt"]
let va_codegen_success_Xgetbv_Avx512 () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Xgetbv_Avx512 va_b0 va_s0 =
va_reveal_opaque (`%va_code_Xgetbv_Avx512) (va_code_Xgetbv_Avx512 ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Xgetbv))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Xgetbv))) va_s0 in
Vale.X64.CPU_Features_s.xgetbv_features ();
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Xgetbv_Avx512 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Xgetbv_Avx512 (va_code_Xgetbv_Avx512 ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok
va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_reg64 rRdx; va_Mod_reg64 rRax]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Nat64Equal
[@ "opaque_to_smt"]
let va_code_Nat64Equal dst src =
(va_Block (va_CCons (va_code_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src) (va_const_opr64
18446744073709551615)) (va_CCons (va_code_Mov64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CCons (va_code_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0)) (va_CNil ())))))
[@ "opaque_to_smt"]
let va_codegen_success_Nat64Equal dst src =
(va_pbool_and (va_codegen_success_Sub64Wrap (va_coerce_reg_opr64_to_dst_opr64 src)
(va_const_opr64 18446744073709551615)) (va_pbool_and (va_codegen_success_Mov64
(va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_pbool_and
(va_codegen_success_Adc64 (va_coerce_reg_opr64_to_dst_opr64 dst) (va_const_opr64 0)) (va_ttrue
()))))
[@"opaque_to_smt"]
let va_lemma_Nat64Equal va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Nat64Equal) (va_code_Nat64Equal dst src);
let (va_old_s:va_state) = va_s0 in
let (va_b1:va_codes) = va_get_block va_b0 in
let (va_s2, va_fc2) = va_lemma_Sub64Wrap (va_hd va_b1) va_s0 (va_coerce_reg_opr64_to_dst_opr64
src) (va_const_opr64 18446744073709551615) in
let va_b2 = va_tl va_b1 in
let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b2) va_s2 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b3 = va_tl va_b2 in
let (va_s4, va_fc4) = va_lemma_Adc64 (va_hd va_b3) va_s3 (va_coerce_reg_opr64_to_dst_opr64 dst)
(va_const_opr64 0) in
let va_b4 = va_tl va_b3 in
let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in
let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in
let va_f2 = va_lemma_merge_total va_b2 va_s2 va_fc3 va_s3 va_f3 va_sM in
let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc2 va_s2 va_f2 va_sM in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Nat64Equal dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Nat64Equal (va_code_Nat64Equal dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_reg_opr64
src va_sM (va_update_operand_reg_opr64 dst va_sM va_s0)))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_reg_opr64 src; va_mod_reg_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Comment
[@ "opaque_to_smt"]
let va_code_Comment c =
(mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_Comment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Comment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_Comment) (va_code_Comment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Comment c) (S.AnnotateComment c))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Comment c)
(S.AnnotateComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Comment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Comment (va_code_Comment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- LargeComment
[@ "opaque_to_smt"]
let va_code_LargeComment c =
(mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
[@ "opaque_to_smt"]
let va_codegen_success_LargeComment c =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_LargeComment va_b0 va_s0 c =
va_reveal_opaque (`%va_code_LargeComment) (va_code_LargeComment c);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_LargeComment c) (S.AnnotateLargeComment c)))
va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_LargeComment c)
(S.AnnotateLargeComment c))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_LargeComment c va_s0 va_k =
let (va_sM, va_f0) = va_lemma_LargeComment (va_code_LargeComment c) va_s0 c in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- NoNewline
[@ "opaque_to_smt"]
let va_code_NoNewline () =
(mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0)))
[@ "opaque_to_smt"]
let va_codegen_success_NoNewline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_NoNewline va_b0 va_s0 =
va_reveal_opaque (`%va_code_NoNewline) (va_code_NoNewline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace 0))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Space 0) (S.AnnotateSpace
0))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_NoNewline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_NoNewline (va_code_NoNewline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Newline
[@ "opaque_to_smt"]
let va_code_Newline () =
(mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ())))
[@ "opaque_to_smt"]
let va_codegen_success_Newline () =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Newline va_b0 va_s0 =
va_reveal_opaque (`%va_code_Newline) (va_code_Newline ());
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline ()))) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Newline) (S.AnnotateNewline
()))) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Newline va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Newline (va_code_Newline ()) va_s0 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM va_s0));
va_lemma_norm_mods ([]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Space
[@ "opaque_to_smt"]
let va_code_Space n =
(mk_ins (make_instr_annotate (I.ins_Space n) (S.AnnotateSpace n)))
[@ "opaque_to_smt"] | false | true | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_codegen_success_Space : n:nat -> Tot va_pbool | [] | Vale.X64.InsBasic.va_codegen_success_Space | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> Vale.X64.Decls.va_pbool | {
"end_col": 15,
"end_line": 1165,
"start_col": 2,
"start_line": 1165
} |
Prims.Ghost | val va_lemma_Adox64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adox64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_of (va_get_flags va_sM)
(va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ Vale.X64.Decls.maintained_cf (va_get_flags
va_sM) (va_get_flags va_s0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [
{
"abbrev": true,
"full_module": "Vale.X64.Machine_Semantics_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "Vale.X64.Instructions_s",
"short_module": "I"
},
{
"abbrev": false,
"full_module": "Vale.X64.Stack_i",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Taint_Semantics",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.StateLemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_lemma_Adox64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM) | val va_lemma_Adox64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adox64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_of (va_get_flags va_sM)
(va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ Vale.X64.Decls.maintained_cf (va_get_flags
va_sM) (va_get_flags va_s0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0)))))
let va_lemma_Adox64Wrap va_b0 va_s0 dst src = | false | null | false | va_reveal_opaque (`%va_code_Adox64Wrap) (va_code_Adox64Wrap dst src);
let va_old_s:va_state = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0;
let va_sM, va_fM = va_eval_ins (mk_ins (make_instr (I.ins_Adox64) dst src)) va_s0 in
(va_sM, va_fM) | {
"checked_file": "Vale.X64.InsBasic.fst.checked",
"dependencies": [
"Vale.X64.Taint_Semantics.fst.checked",
"Vale.X64.StateLemmas.fsti.checked",
"Vale.X64.Stack_i.fsti.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_Semantics_s.fst.checked",
"Vale.X64.Instructions_s.fsti.checked",
"Vale.X64.InsLemmas.fsti.checked",
"Vale.X64.Decls.fst.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Arch.Types.fsti.checked",
"prims.fst.checked",
"FStar.UInt.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": true,
"source_file": "Vale.X64.InsBasic.fst"
} | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.X64.Decls.va_operand_dst_opr64",
"Vale.X64.Decls.va_operand_opr64",
"Vale.X64.State.vale_state",
"Vale.X64.Lemmas.fuel",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"FStar.Pervasives.Native.tuple2",
"Prims.nat",
"Vale.X64.Decls.va_eval_ins",
"Vale.X64.Taint_Semantics.mk_ins",
"Vale.X64.InsLemmas.make_instr",
"Prims.Cons",
"Vale.X64.Instruction_s.instr_out",
"Vale.X64.Instruction_s.inOut",
"Vale.X64.Instruction_s.opFlagsOf",
"Vale.X64.Instruction_s.op64",
"Prims.Nil",
"Vale.X64.Instruction_s.instr_operand",
"Vale.X64.Instruction_s.PreserveFlags",
"Vale.X64.Instructions_s.ins_Adox64",
"Prims.unit",
"Vale.X64.Decls.va_ins_lemma",
"Vale.X64.Decls.va_reveal_opaque",
"Vale.X64.InsBasic.va_code_Adox64Wrap"
] | [] | module Vale.X64.InsBasic
open Vale.X64
open Vale.X64.StateLemmas
open Vale.X64.InsLemmas
open Vale.X64.Taint_Semantics
open Vale.X64.CPU_Features_s
open Vale.X64.Memory
open Vale.X64.Stack_i
module I = Vale.X64.Instructions_s
module S = Vale.X64.Machine_Semantics_s
friend Vale.X64.Decls
#reset-options "--initial_fuel 5 --max_fuel 5 --max_ifuel 2 --z3rlimit 20"
//-- Mov64
[@ "opaque_to_smt"]
let va_code_Mov64 dst src =
(mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Mov64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Mov64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Mov64) (va_code_Mov64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ()) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr_annotate (I.ins_Mov64) (S.AnnotateMov64 ())
dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Mov64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Mov64 (va_code_Mov64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Cmovc64
[@ "opaque_to_smt"]
let va_code_Cmovc64 dst src =
(mk_ins (make_instr (I.ins_Cmovc64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Cmovc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Cmovc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Cmovc64) (va_code_Cmovc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Cmovc64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Cmovc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Cmovc64 (va_code_Cmovc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64
[@ "opaque_to_smt"]
let va_code_Add64 dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64) (va_code_Add64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64 (va_code_Add64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Add64Wrap
[@ "opaque_to_smt"]
let va_code_Add64Wrap dst src =
(mk_ins (make_instr (I.ins_Add64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Add64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Add64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Add64Wrap) (va_code_Add64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Add64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Add64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Add64Wrap (va_code_Add64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- AddLea64
[@ "opaque_to_smt"]
let va_code_AddLea64 dst src1 src2 =
(mk_ins (make_instr (I.ins_AddLea64) dst src1 src2))
[@ "opaque_to_smt"]
let va_codegen_success_AddLea64 dst src1 src2 =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_AddLea64 va_b0 va_s0 dst src1 src2 =
va_reveal_opaque (`%va_code_AddLea64) (va_code_AddLea64 dst src1 src2);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddLea64) dst src1 src2)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_AddLea64 dst src1 src2 va_s0 va_k =
let (va_sM, va_f0) = va_lemma_AddLea64 (va_code_AddLea64 dst src1 src2) va_s0 dst src1 src2 in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 dst va_sM va_s0)));
va_lemma_norm_mods ([va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64
[@ "opaque_to_smt"]
let va_code_Adc64 dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64 dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64 va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64) (va_code_Adc64 dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64 dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64 (va_code_Adc64 dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adc64Wrap
[@ "opaque_to_smt"]
let va_code_Adc64Wrap dst src =
(mk_ins (make_instr (I.ins_AddCarry64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adc64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adc64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adc64Wrap) (va_code_Adc64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_AddCarry64) dst src)) va_s0 in
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adc64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adc64Wrap (va_code_Adc64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
//--
//-- Adcx64Wrap
#push-options "--smtencoding.nl_arith_repr boxwrap"
[@ "opaque_to_smt"]
let va_code_Adcx64Wrap dst src =
(mk_ins (make_instr (I.ins_Adcx64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adcx64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"]
let va_lemma_Adcx64Wrap va_b0 va_s0 dst src =
va_reveal_opaque (`%va_code_Adcx64Wrap) (va_code_Adcx64Wrap dst src);
let (va_old_s:va_state) = va_s0 in
va_ins_lemma (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0;
let (va_sM, va_fM) = va_eval_ins (mk_ins (make_instr (I.ins_Adcx64) dst src)) va_s0 in
assert (Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64 (va_eval_dst_opr64 va_old_s dst)
(va_eval_opr64 va_old_s src)) (if Vale.X64.Decls.cf (va_get_flags va_old_s) then 1 else 0) ==
(va_eval_dst_opr64 va_old_s dst + va_eval_opr64 va_old_s src + (if Vale.X64.Decls.cf
(va_get_flags va_old_s) then 1 else 0)) `op_Modulus` pow2_64);
(va_sM, va_fM)
[@"opaque_to_smt"]
let va_wpProof_Adcx64Wrap dst src va_s0 va_k =
let (va_sM, va_f0) = va_lemma_Adcx64Wrap (va_code_Adcx64Wrap dst src) va_s0 dst src in
va_lemma_upd_update va_sM;
assert (va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM (va_update_operand_dst_opr64
dst va_sM va_s0))));
va_lemma_norm_mods ([va_Mod_flags; va_mod_dst_opr64 dst]) va_sM va_s0;
let va_g = () in
(va_sM, va_f0, va_g)
#pop-options
//--
//-- Adox64Wrap
[@ "opaque_to_smt"]
let va_code_Adox64Wrap dst src =
(mk_ins (make_instr (I.ins_Adox64) dst src))
[@ "opaque_to_smt"]
let va_codegen_success_Adox64Wrap dst src =
(va_ttrue ())
[@"opaque_to_smt"] | false | false | Vale.X64.InsBasic.fst | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 5,
"initial_ifuel": 0,
"max_fuel": 5,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 20,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_lemma_Adox64Wrap : va_b0:va_code -> va_s0:va_state -> dst:va_operand_dst_opr64 ->
src:va_operand_opr64
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Adox64Wrap dst src) va_s0 /\ va_is_dst_dst_opr64 dst
va_s0 /\ va_is_src_opr64 src va_s0 /\ va_get_ok va_s0 /\ adx_enabled /\ Vale.X64.Decls.valid_of
(va_get_flags va_s0)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_dst_opr64 va_sM dst == Vale.Arch.Types.add_wrap64 (Vale.Arch.Types.add_wrap64
(va_eval_dst_opr64 va_s0 dst) (va_eval_opr64 va_s0 src)) (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) /\ Vale.X64.Decls.updated_of (va_get_flags va_sM)
(va_eval_dst_opr64 va_s0 dst + va_eval_opr64 va_s0 src + (if Vale.X64.Decls.overflow
(va_get_flags va_s0) then 1 else 0) >= pow2_64) /\ Vale.X64.Decls.maintained_cf (va_get_flags
va_sM) (va_get_flags va_s0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_ok va_sM
(va_update_operand_dst_opr64 dst va_sM va_s0))))) | [] | Vale.X64.InsBasic.va_lemma_Adox64Wrap | {
"file_name": "obj/Vale.X64.InsBasic.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
dst: Vale.X64.Decls.va_operand_dst_opr64 ->
src: Vale.X64.Decls.va_operand_opr64
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | {
"end_col": 16,
"end_line": 273,
"start_col": 2,
"start_line": 269
} |
Subsets and Splits