file_name
stringlengths
5
52
name
stringlengths
4
95
original_source_type
stringlengths
0
23k
source_type
stringlengths
9
23k
source_definition
stringlengths
9
57.9k
source
dict
source_range
dict
file_context
stringlengths
0
721k
dependencies
dict
opens_and_abbrevs
listlengths
2
94
vconfig
dict
interleaved
bool
1 class
verbose_type
stringlengths
1
7.42k
effect
stringclasses
118 values
effect_flags
sequencelengths
0
2
mutual_with
sequencelengths
0
11
ideal_premises
sequencelengths
0
236
proof_features
sequencelengths
0
1
is_simple_lemma
bool
2 classes
is_div
bool
2 classes
is_proof
bool
2 classes
is_simply_typed
bool
2 classes
is_type
bool
2 classes
partial_definition
stringlengths
5
3.99k
completed_definiton
stringlengths
1
1.63M
isa_cross_project_example
bool
1 class
FStar.Stubs.Tactics.Types.fsti
FStar.Stubs.Tactics.Types.issues
val issues : Type0
let issues = list FStar.Issue.issue
{ "file_name": "ulib/FStar.Stubs.Tactics.Types.fsti", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 35, "end_line": 71, "start_col": 0, "start_line": 71 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module FStar.Stubs.Tactics.Types open FStar.Stubs.Reflection.Types include FStar.Stubs.Tactics.Common include FStar.Stubs.TypeChecker.Core assume new type goal assume new type proofstate (* Returns the active goals *) val goals_of : proofstate -> list goal (* Returns the goals marked for SMT *) val smt_goals_of : proofstate -> list goal (* Inspecting a goal *) val goal_env : goal -> env val goal_type : goal -> typ val goal_witness : goal -> term val is_guard : goal -> bool (* A bit of helper info: did this goal come from a VC guard? *) val get_label : goal -> string val set_label : string -> goal -> goal (* Tracing *) val incr_depth : proofstate -> proofstate val decr_depth : proofstate -> proofstate (* [tracepoint] always returns true. We do not use unit to prevent erasure. *) val tracepoint : proofstate -> b:bool{b == true} val set_proofstate_range : proofstate -> FStar.Range.range -> proofstate type direction = | TopDown | BottomUp type ctrl_flag = | Continue | Skip | Abort type guard_policy = | Goal // Add guards as (normal) goals | SMT // Add guards as SMT goals | SMTSync // Send guards to SMT immediately, will *log* errors (not raise) if anything fails | Force // Force guards without SMT | Drop // Drop guards, clearly unsound! careful! (* Typing reflection *) val non_informative_token (g:env) (t:typ) : Type0 val subtyping_token (g:env) (t0 t1:typ) : Type0 val equiv_token (g:env) (t0 t1:typ) : Type0 val typing_token (g:env) (e:term) (c:tot_or_ghost & typ) : Type0 (* Must be inline, this definition is not there in src/FStar.Tactics.Types *)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "FStar.Stubs.TypeChecker.Core.fsti.checked", "FStar.Stubs.Tactics.Common.fsti.checked", "FStar.Stubs.Reflection.Types.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Issue.fsti.checked" ], "interface_file": false, "source_file": "FStar.Stubs.Tactics.Types.fsti" }
[ { "abbrev": false, "full_module": "FStar.Stubs.TypeChecker.Core", "short_module": null }, { "abbrev": false, "full_module": "FStar.Stubs.Tactics.Common", "short_module": null }, { "abbrev": false, "full_module": "FStar.Stubs.Reflection.Types", "short_module": null }, { "abbrev": false, "full_module": "FStar.Stubs.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Stubs.Tactics", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "Prims.list", "FStar.Issue.issue" ]
[]
false
false
false
true
true
let issues =
list FStar.Issue.issue
false
Vale.Inline.X64.Fadd_inline.fsti
Vale.Inline.X64.Fadd_inline.u1024
val u1024 : Type0
let u1024 = b:B.buffer UInt64.t{B.length b == 16}
{ "file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fadd_inline.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 49, "end_line": 15, "start_col": 0, "start_line": 15 }
module Vale.Inline.X64.Fadd_inline open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack open Vale.Curve25519.Fast_defs open FStar.Mul unfold let u256 = b:B.buffer UInt64.t{B.length b == 4} unfold let u512 = b:B.buffer UInt64.t{B.length b == 8}
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "LowStar.Buffer.fst.checked", "FStar.UInt64.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Inline.X64.Fadd_inline.fsti" }
[ { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "LowStar.Buffer.buffer", "FStar.UInt64.t", "Prims.eq2", "Prims.int", "LowStar.Monotonic.Buffer.length", "LowStar.Buffer.trivial_preorder" ]
[]
false
false
false
true
true
let u1024 =
b: B.buffer UInt64.t {B.length b == 16}
false
Vale.Inline.X64.Fadd_inline.fsti
Vale.Inline.X64.Fadd_inline.u256
val u256 : Type0
let u256 = b:B.buffer UInt64.t{B.length b == 4}
{ "file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fadd_inline.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 11, "start_col": 0, "start_line": 11 }
module Vale.Inline.X64.Fadd_inline open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack open Vale.Curve25519.Fast_defs open FStar.Mul
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "LowStar.Buffer.fst.checked", "FStar.UInt64.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Inline.X64.Fadd_inline.fsti" }
[ { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "LowStar.Buffer.buffer", "FStar.UInt64.t", "Prims.eq2", "Prims.int", "LowStar.Monotonic.Buffer.length", "LowStar.Buffer.trivial_preorder" ]
[]
false
false
false
true
true
let u256 =
b: B.buffer UInt64.t {B.length b == 4}
false
Vale.Inline.X64.Fadd_inline.fsti
Vale.Inline.X64.Fadd_inline.u512
val u512 : Type0
let u512 = b:B.buffer UInt64.t{B.length b == 8}
{ "file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fadd_inline.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 47, "end_line": 13, "start_col": 0, "start_line": 13 }
module Vale.Inline.X64.Fadd_inline open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack open Vale.Curve25519.Fast_defs open FStar.Mul unfold let u256 = b:B.buffer UInt64.t{B.length b == 4}
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "LowStar.Buffer.fst.checked", "FStar.UInt64.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Inline.X64.Fadd_inline.fsti" }
[ { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "LowStar.Buffer.buffer", "FStar.UInt64.t", "Prims.eq2", "Prims.int", "LowStar.Monotonic.Buffer.length", "LowStar.Buffer.trivial_preorder" ]
[]
false
false
false
true
true
let u512 =
b: B.buffer UInt64.t {B.length b == 8}
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.elab_st_sub
val elab_st_sub (#g: env) (#c1 #c2: comp) (d_sub: st_sub g c1 c2) : Tot (t: R.term & RT.tot_typing (elab_env g) t (simple_arr (elab_comp c1) (elab_comp c2)))
val elab_st_sub (#g: env) (#c1 #c2: comp) (d_sub: st_sub g c1 c2) : Tot (t: R.term & RT.tot_typing (elab_env g) t (simple_arr (elab_comp c1) (elab_comp c2)))
let elab_st_sub (#g:env) (#c1 #c2 : comp) (d_sub : st_sub g c1 c2) : Tot (t:R.term & RT.tot_typing (elab_env g) t (simple_arr (elab_comp c1) (elab_comp c2))) = RU.magic_s "elab_st_sub"
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 26, "end_line": 161, "start_col": 0, "start_line": 157 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e let elab_bind #g #x #c1 #c2 #c (bc:bind_comp g x c1 c2 c) (e1 e2:R.term) : R.term = let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 let elab_lift #g #c1 #c2 (d:lift_comp g c1 c2) (e:R.term) : Tot R.term = match d with | Lift_STAtomic_ST _ _ -> let t = elab_term (comp_res c1) in mk_lift_atomic_stt (comp_u c1) (elab_term (comp_res c1)) t (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Observability _ c o2 -> let t = elab_term (comp_res c1) in mk_lift_observability (comp_u c1) (elab_observability (C_STAtomic?.obs c)) (elab_observability o2) (elab_term (comp_inames c1)) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Ghost_Neutral _ _ (| reveal_a, reveal_a_typing |) -> let t = elab_term (comp_res c1) in mk_lift_ghost_neutral (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e (elab_term reveal_a) | Lift_Neutral_Ghost _ c -> let t = elab_term (comp_res c1) in mk_lift_neutral_ghost (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e let intro_pure_tm (p:term) = let open Pulse.Reflection.Util in wtag (Some STT_Ghost) (Tm_STApp { head = tm_pureapp (tm_fvar (as_fv (mk_pulse_lib_core_lid "intro_pure"))) None p; arg_qual = None; arg = tm_fstar (`()) Range.range_0 }) let simple_arr (t1 t2 : R.term) : R.term = let b = R.pack_binder { sort = t1; ppname = Sealed.seal "x"; qual = R.Q_Explicit; attrs = [] } in R.pack_ln (R.Tv_Arrow b (R.pack_comp (R.C_Total t2)))
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
d_sub: Pulse.Typing.st_sub g c1 c2 -> Prims.dtuple2 FStar.Stubs.Reflection.Types.term (fun t -> FStar.Reflection.Typing.tot_typing (Pulse.Typing.elab_env g) t (Pulse.Elaborate.Core.simple_arr (Pulse.Elaborate.Pure.elab_comp c1) (Pulse.Elaborate.Pure.elab_comp c2)))
Prims.Tot
[ "total" ]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.comp", "Pulse.Typing.st_sub", "Pulse.RuntimeUtils.magic_s", "Prims.dtuple2", "FStar.Stubs.Reflection.Types.term", "FStar.Reflection.Typing.tot_typing", "Pulse.Typing.elab_env", "Pulse.Elaborate.Core.simple_arr", "Pulse.Elaborate.Pure.elab_comp" ]
[]
false
false
false
false
false
let elab_st_sub (#g: env) (#c1 #c2: comp) (d_sub: st_sub g c1 c2) : Tot (t: R.term & RT.tot_typing (elab_env g) t (simple_arr (elab_comp c1) (elab_comp c2))) =
RU.magic_s "elab_st_sub"
false
Pulse.Checker.IntroPure.fst
Pulse.Checker.IntroPure.check_prop_validity
val check_prop_validity (g: env) (p: term) (typing: tot_typing g p tm_prop) : T.Tac (prop_validity g p)
val check_prop_validity (g: env) (p: term) (typing: tot_typing g p tm_prop) : T.Tac (prop_validity g p)
let check_prop_validity (g:env) (p:term) (typing:tot_typing g p tm_prop): T.Tac (prop_validity g p) = Pulse.Checker.Pure.check_prop_validity g p typing
{ "file_name": "lib/steel/pulse/Pulse.Checker.IntroPure.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 53, "end_line": 44, "start_col": 0, "start_line": 43 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Checker.IntroPure open Pulse.Syntax open Pulse.Typing open Pulse.Checker.Base open Pulse.Checker.Prover module T = FStar.Tactics.V2 module P = Pulse.Syntax.Printer let check_prop (g:env) (p:term) : T.Tac (p:term & tot_typing g p tm_prop) = let p0 = p in let (| p, p_typing |) = Pulse.Checker.Pure.check_vprop g (tm_pure p) in match p.t with | Tm_Pure pp -> let prop_typing = Pulse.Typing.Metatheory.pure_typing_inversion #_ #pp p_typing in (| pp, prop_typing |) | _ -> fail g None (Printf.sprintf "Impossible: check_intro_pure: checking a pure vprop %s returned a non-pure vprop %s,\ please file a bug-report" (P.term_to_string (tm_pure p0)) (P.term_to_string p))
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.Metatheory.fsti.checked", "Pulse.Typing.Env.fsti.checked", "Pulse.Typing.fst.checked", "Pulse.Syntax.Printer.fsti.checked", "Pulse.Syntax.fst.checked", "Pulse.Checker.Pure.fsti.checked", "Pulse.Checker.Prover.fsti.checked", "Pulse.Checker.Base.fsti.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Printf.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Pulse.Checker.IntroPure.fst" }
[ { "abbrev": true, "full_module": "Pulse.Syntax.Printer", "short_module": "P" }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Prover", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": false, "full_module": "Pulse.Checker.Base", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Checker", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
g: Pulse.Typing.Env.env -> p: Pulse.Syntax.Base.term -> typing: Pulse.Typing.tot_typing g p Pulse.Typing.tm_prop -> FStar.Tactics.Effect.Tac (Pulse.Typing.prop_validity g p)
FStar.Tactics.Effect.Tac
[]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Typing.tm_prop", "Pulse.Checker.Pure.check_prop_validity", "Pulse.Typing.prop_validity" ]
[]
false
true
false
false
false
let check_prop_validity (g: env) (p: term) (typing: tot_typing g p tm_prop) : T.Tac (prop_validity g p) =
Pulse.Checker.Pure.check_prop_validity g p typing
false
Vale.Inline.X64.Fadd_inline.fsti
Vale.Inline.X64.Fadd_inline.as_nat
val as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat
val as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat
let as_nat (b:B.buffer UInt64.t{B.length b == 4}) (h:HS.mem) : GTot nat = let s = B.as_seq h b in let s0 = UInt64.v (Seq.index s 0) in let s1 = UInt64.v (Seq.index s 1) in let s2 = UInt64.v (Seq.index s 2) in let s3 = UInt64.v (Seq.index s 3) in pow2_four s0 s1 s2 s3
{ "file_name": "vale/code/arch/x64/interop/Vale.Inline.X64.Fadd_inline.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 23, "end_line": 23, "start_col": 0, "start_line": 17 }
module Vale.Inline.X64.Fadd_inline open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack open Vale.Curve25519.Fast_defs open FStar.Mul unfold let u256 = b:B.buffer UInt64.t{B.length b == 4} unfold let u512 = b:B.buffer UInt64.t{B.length b == 8} unfold let u1024 = b:B.buffer UInt64.t{B.length b == 16}
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Curve25519.Fast_defs.fst.checked", "prims.fst.checked", "LowStar.Buffer.fst.checked", "FStar.UInt64.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Inline.X64.Fadd_inline.fsti" }
[ { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Inline.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b: LowStar.Buffer.buffer FStar.UInt64.t {LowStar.Monotonic.Buffer.length b == 4} -> h: FStar.Monotonic.HyperStack.mem -> Prims.GTot Prims.nat
Prims.GTot
[ "sometrivial" ]
[]
[ "LowStar.Buffer.buffer", "FStar.UInt64.t", "Prims.eq2", "Prims.int", "LowStar.Monotonic.Buffer.length", "LowStar.Buffer.trivial_preorder", "FStar.Monotonic.HyperStack.mem", "Vale.Curve25519.Fast_defs.pow2_four", "FStar.UInt.uint_t", "FStar.UInt64.v", "FStar.Seq.Base.index", "FStar.Seq.Base.seq", "LowStar.Monotonic.Buffer.as_seq", "Prims.nat" ]
[]
false
false
false
false
false
let as_nat (b: B.buffer UInt64.t {B.length b == 4}) (h: HS.mem) : GTot nat =
let s = B.as_seq h b in let s0 = UInt64.v (Seq.index s 0) in let s1 = UInt64.v (Seq.index s 1) in let s2 = UInt64.v (Seq.index s 2) in let s3 = UInt64.v (Seq.index s 3) in pow2_four s0 s1 s2 s3
false
Vale.Stdcalls.X64.Aes.fst
Vale.Stdcalls.X64.Aes.aes128_key_expansion
val aes128_key_expansion : normal lowstar_key128_t
val aes128_key_expansion : normal lowstar_key128_t
let aes128_key_expansion //: normal lowstar_key128_t = as_normal_t #lowstar_key128_t lowstar_key128
{ "file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Aes.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 48, "end_line": 31, "start_col": 0, "start_line": 30 }
module Vale.Stdcalls.X64.Aes open FStar.Mul open FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open Vale.Def.Types_s open Vale.Interop.Base module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module ME = Vale.X64.Memory module V = Vale.X64.Decls module IA = Vale.Interop.Assumptions module W = Vale.AsLowStar.Wrapper open Vale.X64.MemoryAdapters module VS = Vale.X64.State module MS = Vale.X64.Machine_s let lowstar_key128 : lowstar_key128_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key128 dom (W.mk_prediction code_key128 dom [] (key128_lemma code_key128 IA.win))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.AsLowStar.Wrapper.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": true, "source_file": "Vale.Stdcalls.X64.Aes.fst" }
[ { "abbrev": true, "full_module": "Vale.AES.X64.AES", "short_module": "AE" }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Vale.Interop.Base.normal Vale.Stdcalls.X64.Aes.lowstar_key128_t
Prims.Tot
[ "total" ]
[]
[ "Vale.Stdcalls.X64.Aes.as_normal_t", "Vale.Stdcalls.X64.Aes.lowstar_key128_t", "Vale.Stdcalls.X64.Aes.lowstar_key128" ]
[]
false
false
false
true
false
let aes128_key_expansion =
as_normal_t #lowstar_key128_t lowstar_key128
false
Vale.Stdcalls.X64.Aes.fst
Vale.Stdcalls.X64.Aes.aes256_key_expansion
val aes256_key_expansion : normal lowstar_key256_t
val aes256_key_expansion : normal lowstar_key256_t
let aes256_key_expansion //: normal lowstar_key256_t = as_normal_t #lowstar_key256_t lowstar_key256
{ "file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Aes.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 48, "end_line": 41, "start_col": 0, "start_line": 40 }
module Vale.Stdcalls.X64.Aes open FStar.Mul open FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open Vale.Def.Types_s open Vale.Interop.Base module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module ME = Vale.X64.Memory module V = Vale.X64.Decls module IA = Vale.Interop.Assumptions module W = Vale.AsLowStar.Wrapper open Vale.X64.MemoryAdapters module VS = Vale.X64.State module MS = Vale.X64.Machine_s let lowstar_key128 : lowstar_key128_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key128 dom (W.mk_prediction code_key128 dom [] (key128_lemma code_key128 IA.win)) let aes128_key_expansion //: normal lowstar_key128_t = as_normal_t #lowstar_key128_t lowstar_key128 let lowstar_key256 : lowstar_key256_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key256 dom (W.mk_prediction code_key256 dom [] (key256_lemma code_key256 IA.win))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.AsLowStar.Wrapper.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": true, "source_file": "Vale.Stdcalls.X64.Aes.fst" }
[ { "abbrev": true, "full_module": "Vale.AES.X64.AES", "short_module": "AE" }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Vale.Interop.Base.normal Vale.Stdcalls.X64.Aes.lowstar_key256_t
Prims.Tot
[ "total" ]
[]
[ "Vale.Stdcalls.X64.Aes.as_normal_t", "Vale.Stdcalls.X64.Aes.lowstar_key256_t", "Vale.Stdcalls.X64.Aes.lowstar_key256" ]
[]
false
false
false
true
false
let aes256_key_expansion =
as_normal_t #lowstar_key256_t lowstar_key256
false
IfcRulesReify.fst
IfcRulesReify.op_Less
val op_Less : label -> label -> Tot bool
val op_Less : label -> label -> Tot bool
let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 17, "end_line": 36, "start_col": 0, "start_line": 33 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
l1: IfcRulesReify.label -> l2: IfcRulesReify.label -> Prims.bool
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label", "FStar.Pervasives.Native.Mktuple2", "Prims.bool" ]
[]
false
false
false
true
false
let ( < ) l1 l2 =
match l1, l2 with | Low, High -> true | _, _ -> false
false
IfcRulesReify.fst
IfcRulesReify.op_Less_Equals
val op_Less_Equals : label -> label -> Tot bool
val op_Less_Equals : label -> label -> Tot bool
let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 16, "end_line": 42, "start_col": 0, "start_line": 39 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
l1: IfcRulesReify.label -> l2: IfcRulesReify.label -> Prims.bool
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label", "FStar.Pervasives.Native.Mktuple2", "Prims.bool" ]
[]
false
false
false
true
false
let ( <= ) l1 l2 =
match l1, l2 with | High, Low -> false | _, _ -> true
false
IfcRulesReify.fst
IfcRulesReify.ni_exp
val ni_exp (env: label_fun) (e: exp) (l: label) : Tot Type0
val ni_exp (env: label_fun) (e: exp) (l: label) : Tot Type0
let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 8, "end_line": 80, "start_col": 0, "start_line": 72 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> e: WhileReify.exp -> l: IfcRulesReify.label -> Type0
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.exp", "IfcRulesReify.label", "Prims.l_Forall", "Rel.rel", "FStar.DM4F.Heap.IntStoreFixed.heap", "Prims.l_imp", "Prims.l_and", "IfcRulesReify.low_equiv", "Prims.b2t", "IfcRulesReify.uu___is_Low", "Prims.op_Equality", "Prims.int", "WhileReify.interpret_exp_st", "Rel.__proj__R__item__l", "Rel.__proj__R__item__r" ]
[]
false
false
false
true
true
let ni_exp (env: label_fun) (e: exp) (l: label) : Tot Type0 =
forall (h: rel heap). (low_equiv env h /\ Low? l) ==> (let vr = reify (interpret_exp_st e) (R?.r h) in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl)
false
IfcRulesReify.fst
IfcRulesReify.join
val join : label -> label -> Tot label
val join : label -> label -> Tot label
let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 16, "end_line": 48, "start_col": 0, "start_line": 45 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
l1: IfcRulesReify.label -> l2: IfcRulesReify.label -> IfcRulesReify.label
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label", "FStar.Pervasives.Native.Mktuple2", "IfcRulesReify.Low", "IfcRulesReify.High" ]
[]
false
false
false
true
false
let join l1 l2 =
match l1, l2 with | Low, Low -> Low | _, _ -> High
false
IfcRulesReify.fst
IfcRulesReify.meet
val meet : label -> label -> Tot label
val meet : label -> label -> Tot label
let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 15, "end_line": 54, "start_col": 0, "start_line": 51 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
l1: IfcRulesReify.label -> l2: IfcRulesReify.label -> IfcRulesReify.label
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label", "FStar.Pervasives.Native.Mktuple2", "IfcRulesReify.High", "IfcRulesReify.Low" ]
[]
false
false
false
true
false
let meet l1 l2 =
match l1, l2 with | High, High -> High | _, _ -> Low
false
IfcRulesReify.fst
IfcRulesReify.ni_com'
val ni_com' (env: label_fun) (c: com) (l: label) (h0: rel heap) : Tot Type0
val ni_com' (env: label_fun) (c: com) (l: label) (h0: rel heap) : Tot Type0
let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 5, "end_line": 110, "start_col": 0, "start_line": 96 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> c: WhileReify.com -> l: IfcRulesReify.label -> h0: Rel.rel FStar.DM4F.Heap.IntStoreFixed.heap -> Type0
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.com", "IfcRulesReify.label", "Rel.rel", "FStar.DM4F.Heap.IntStoreFixed.heap", "WhileReify.interpret_com", "Prims.l_imp", "IfcRulesReify.low_equiv", "Rel.R", "FStar.Pervasives.Native.option", "Prims.l_True" ]
[]
false
false
false
true
true
let ni_com' (env: label_fun) (c: com) (l: label) (h0: rel heap) : Tot Type0 =
let R h0l h0r = h0 in match interpret_com h0l c with | Some h1l -> (match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True) | _ -> True
false
IfcRulesReify.fst
IfcRulesReify.ni_com
val ni_com (env: label_fun) (c: com) (l: label) : Tot Type0
val ni_com (env: label_fun) (c: com) (l: label) : Tot Type0
let ni_com (env:label_fun) (c:com) (l:label) : Tot Type0 = (forall (h0: rel heap). (* {:pattern (low_equiv env h0)} *) ni_com' env c l h0) /\ (forall (h0:heap). (* {:pattern (Some? (interpret_com h0 c))} *) inv_com' env c l h0)
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 87, "end_line": 114, "start_col": 0, "start_line": 112 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> c: WhileReify.com -> l: IfcRulesReify.label -> Type0
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.com", "IfcRulesReify.label", "Prims.l_and", "Prims.l_Forall", "Rel.rel", "FStar.DM4F.Heap.IntStoreFixed.heap", "IfcRulesReify.ni_com'", "IfcRulesReify.inv_com'" ]
[]
false
false
false
true
true
let ni_com (env: label_fun) (c: com) (l: label) : Tot Type0 =
(forall (h0: rel heap). ni_com' env c l h0) /\ (forall (h0: heap). inv_com' env c l h0)
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.elab_frame
val elab_frame : c: Pulse.Syntax.Base.comp_st -> frame: Pulse.Syntax.Base.term -> e: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 84, "end_line": 39, "start_col": 0, "start_line": 29 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c: Pulse.Syntax.Base.comp_st -> frame: Pulse.Syntax.Base.term -> e: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Syntax.Base.comp_st", "Pulse.Syntax.Base.term", "FStar.Stubs.Reflection.Types.term", "Pulse.Syntax.Base.uu___is_C_ST", "Pulse.Reflection.Util.mk_frame_stt", "Pulse.Reflection.Util.mk_abs", "FStar.Stubs.Reflection.V2.Data.Q_Explicit", "Pulse.Elaborate.Pure.elab_term", "Prims.bool", "Pulse.Syntax.Base.uu___is_C_STAtomic", "Pulse.Reflection.Util.mk_frame_stt_atomic", "Pulse.Syntax.Base.comp_inames", "Pulse.Reflection.Util.mk_frame_stt_ghost", "Pulse.Syntax.Base.comp_post", "Pulse.Syntax.Base.comp_pre", "Pulse.Syntax.Base.comp_res", "Pulse.Syntax.Base.universe", "Pulse.Syntax.Base.comp_u" ]
[]
false
false
false
true
false
let elab_frame (c: comp_st) (frame: term) (e: R.term) =
let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.elab_bind
val elab_bind (#g #x #c1 #c2 #c: _) (bc: bind_comp g x c1 c2 c) (e1 e2: R.term) : R.term
val elab_bind (#g #x #c1 #c2 #c: _) (bc: bind_comp g x c1 c2 c) (e1 e2: R.term) : R.term
let elab_bind #g #x #c1 #c2 #c (bc:bind_comp g x c1 c2 c) (e1 e2:R.term) : R.term = let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 15, "end_line": 93, "start_col": 0, "start_line": 56 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
bc: Pulse.Typing.bind_comp g x c1 c2 c -> e1: FStar.Stubs.Reflection.Types.term -> e2: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.var", "Pulse.Syntax.Base.comp", "Pulse.Typing.bind_comp", "FStar.Stubs.Reflection.Types.term", "Pulse.Syntax.Base.st_comp", "Pulse.Reflection.Util.mk_bind_stt", "Pulse.Syntax.Base.comp_u", "Pulse.Elaborate.Pure.elab_term", "Pulse.Syntax.Base.comp_pre", "Pulse.Reflection.Util.mk_abs", "FStar.Stubs.Reflection.V2.Data.Q_Explicit", "Pulse.Syntax.Base.comp_post", "Pulse.Reflection.Util.mk_bind_ghost", "Pulse.Syntax.Base.term", "Pulse.Syntax.Base.observability", "Pulse.Reflection.Util.mk_bind_atomic", "Pulse.Elaborate.Pure.elab_observability", "Pulse.Syntax.Base.comp_inames", "Pulse.Syntax.Base.comp_res" ]
[]
false
false
false
false
false
let elab_bind #g #x #c1 #c2 #c (bc: bind_comp g x c1 c2 c) (e1: R.term) (e2: R.term) : R.term =
let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.elab_lift
val elab_lift (#g #c1 #c2: _) (d: lift_comp g c1 c2) (e: R.term) : Tot R.term
val elab_lift (#g #c1 #c2: _) (d: lift_comp g c1 c2) (e: R.term) : Tot R.term
let elab_lift #g #c1 #c2 (d:lift_comp g c1 c2) (e:R.term) : Tot R.term = match d with | Lift_STAtomic_ST _ _ -> let t = elab_term (comp_res c1) in mk_lift_atomic_stt (comp_u c1) (elab_term (comp_res c1)) t (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Observability _ c o2 -> let t = elab_term (comp_res c1) in mk_lift_observability (comp_u c1) (elab_observability (C_STAtomic?.obs c)) (elab_observability o2) (elab_term (comp_inames c1)) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Ghost_Neutral _ _ (| reveal_a, reveal_a_typing |) -> let t = elab_term (comp_res c1) in mk_lift_ghost_neutral (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e (elab_term reveal_a) | Lift_Neutral_Ghost _ c -> let t = elab_term (comp_res c1) in mk_lift_neutral_ghost (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 9, "end_line": 136, "start_col": 0, "start_line": 95 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e let elab_bind #g #x #c1 #c2 #c (bc:bind_comp g x c1 c2 c) (e1 e2:R.term) : R.term = let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
d: Pulse.Typing.lift_comp g c1 c2 -> e: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Typing.Env.env", "Pulse.Syntax.Base.comp", "Pulse.Typing.lift_comp", "FStar.Stubs.Reflection.Types.term", "Pulse.Syntax.Base.comp_st", "Prims.b2t", "Pulse.Syntax.Base.uu___is_C_STAtomic", "Pulse.Reflection.Util.mk_lift_atomic_stt", "Pulse.Syntax.Base.comp_u", "Pulse.Elaborate.Pure.elab_term", "Pulse.Syntax.Base.comp_res", "Pulse.Reflection.Util.mk_abs", "FStar.Stubs.Reflection.V2.Data.Q_Explicit", "Pulse.Syntax.Base.comp_post", "Pulse.Syntax.Base.observability", "Pulse.Typing.sub_observability", "Pulse.Syntax.Base.__proj__C_STAtomic__item__obs", "Pulse.Reflection.Util.mk_lift_observability", "Pulse.Elaborate.Pure.elab_observability", "Pulse.Syntax.Base.comp_inames", "Pulse.Syntax.Base.comp_pre", "Pulse.Syntax.Base.uu___is_C_STGhost", "Pulse.Syntax.Base.term", "Pulse.Typing.tot_typing", "Pulse.Typing.non_informative_witness_t", "Pulse.Reflection.Util.mk_lift_ghost_neutral", "Prims.l_and", "Prims.eq2", "Pulse.Syntax.Base.Neutral", "Pulse.Reflection.Util.mk_lift_neutral_ghost" ]
[]
false
false
false
false
false
let elab_lift #g #c1 #c2 (d: lift_comp g c1 c2) (e: R.term) : Tot R.term =
match d with | Lift_STAtomic_ST _ _ -> let t = elab_term (comp_res c1) in mk_lift_atomic_stt (comp_u c1) (elab_term (comp_res c1)) t (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Observability _ c o2 -> let t = elab_term (comp_res c1) in mk_lift_observability (comp_u c1) (elab_observability (C_STAtomic?.obs c)) (elab_observability o2) (elab_term (comp_inames c1)) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Ghost_Neutral _ _ (| reveal_a , reveal_a_typing |) -> let t = elab_term (comp_res c1) in mk_lift_ghost_neutral (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e (elab_term reveal_a) | Lift_Neutral_Ghost _ c -> let t = elab_term (comp_res c1) in mk_lift_neutral_ghost (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.simple_arr
val simple_arr (t1 t2: R.term) : R.term
val simple_arr (t1 t2: R.term) : R.term
let simple_arr (t1 t2 : R.term) : R.term = let b = R.pack_binder { sort = t1; ppname = Sealed.seal "x"; qual = R.Q_Explicit; attrs = [] } in R.pack_ln (R.Tv_Arrow b (R.pack_comp (R.C_Total t2)))
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 55, "end_line": 155, "start_col": 0, "start_line": 149 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e let elab_bind #g #x #c1 #c2 #c (bc:bind_comp g x c1 c2 c) (e1 e2:R.term) : R.term = let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 let elab_lift #g #c1 #c2 (d:lift_comp g c1 c2) (e:R.term) : Tot R.term = match d with | Lift_STAtomic_ST _ _ -> let t = elab_term (comp_res c1) in mk_lift_atomic_stt (comp_u c1) (elab_term (comp_res c1)) t (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Observability _ c o2 -> let t = elab_term (comp_res c1) in mk_lift_observability (comp_u c1) (elab_observability (C_STAtomic?.obs c)) (elab_observability o2) (elab_term (comp_inames c1)) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Ghost_Neutral _ _ (| reveal_a, reveal_a_typing |) -> let t = elab_term (comp_res c1) in mk_lift_ghost_neutral (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e (elab_term reveal_a) | Lift_Neutral_Ghost _ c -> let t = elab_term (comp_res c1) in mk_lift_neutral_ghost (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e let intro_pure_tm (p:term) = let open Pulse.Reflection.Util in wtag (Some STT_Ghost) (Tm_STApp { head = tm_pureapp (tm_fvar (as_fv (mk_pulse_lib_core_lid "intro_pure"))) None p; arg_qual = None; arg = tm_fstar (`()) Range.range_0 })
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
t1: FStar.Stubs.Reflection.Types.term -> t2: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
Prims.Tot
[ "total" ]
[]
[ "FStar.Stubs.Reflection.Types.term", "FStar.Stubs.Reflection.V2.Builtins.pack_ln", "FStar.Stubs.Reflection.V2.Data.Tv_Arrow", "FStar.Stubs.Reflection.V2.Builtins.pack_comp", "FStar.Stubs.Reflection.V2.Data.C_Total", "FStar.Stubs.Reflection.Types.binder", "FStar.Stubs.Reflection.V2.Builtins.pack_binder", "FStar.Stubs.Reflection.V2.Data.Mkbinder_view", "FStar.Stubs.Reflection.V2.Data.Q_Explicit", "Prims.Nil", "FStar.Sealed.seal", "Prims.string" ]
[]
false
false
false
true
false
let simple_arr (t1 t2: R.term) : R.term =
let b = R.pack_binder ({ sort = t1; ppname = Sealed.seal "x"; qual = R.Q_Explicit; attrs = [] }) in R.pack_ln (R.Tv_Arrow b (R.pack_comp (R.C_Total t2)))
false
Vale.Stdcalls.X64.Aes.fst
Vale.Stdcalls.X64.Aes.lowstar_key128
val lowstar_key128:lowstar_key128_t
val lowstar_key128:lowstar_key128_t
let lowstar_key128 : lowstar_key128_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key128 dom (W.mk_prediction code_key128 dom [] (key128_lemma code_key128 IA.win))
{ "file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Aes.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 74, "end_line": 28, "start_col": 0, "start_line": 23 }
module Vale.Stdcalls.X64.Aes open FStar.Mul open FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open Vale.Def.Types_s open Vale.Interop.Base module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module ME = Vale.X64.Memory module V = Vale.X64.Decls module IA = Vale.Interop.Assumptions module W = Vale.AsLowStar.Wrapper open Vale.X64.MemoryAdapters module VS = Vale.X64.State module MS = Vale.X64.Machine_s
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.AsLowStar.Wrapper.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": true, "source_file": "Vale.Stdcalls.X64.Aes.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.AES.X64.AES", "short_module": "AE" }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Vale.Stdcalls.X64.Aes.lowstar_key128_t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.X64.wrap_weak_stdcall", "Vale.Stdcalls.X64.Aes.code_key128", "Vale.Stdcalls.X64.Aes.dom", "Vale.AsLowStar.Wrapper.pre_rel_generic", "Vale.Interop.X64.max_stdcall", "Vale.Interop.X64.arg_reg_stdcall", "Prims.Nil", "Vale.Interop.Base.arg", "Vale.Stdcalls.X64.Aes.key128_pre", "Vale.AsLowStar.Wrapper.post_rel_generic", "Vale.Stdcalls.X64.Aes.key128_post", "Vale.AsLowStar.Wrapper.mk_prediction", "Vale.Interop.X64.regs_modified_stdcall", "Vale.Interop.X64.xmms_modified_stdcall", "Vale.Stdcalls.X64.Aes.key128_lemma", "Vale.Interop.Assumptions.win", "Prims.unit", "FStar.Pervasives.assert_norm", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "FStar.List.Tot.Base.length", "Vale.Interop.Base.td", "Prims.list" ]
[]
false
false
false
true
false
let lowstar_key128:lowstar_key128_t =
assert_norm (List.length dom + List.length ([] <: list arg) <= 4); IX64.wrap_weak_stdcall code_key128 dom (W.mk_prediction code_key128 dom [] (key128_lemma code_key128 IA.win))
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.elab_sub
val elab_sub : c1: Pulse.Syntax.Base.comp_st -> c2: Pulse.Syntax.Base.comp_st -> e: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 52, "end_line": 53, "start_col": 0, "start_line": 41 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
c1: Pulse.Syntax.Base.comp_st -> c2: Pulse.Syntax.Base.comp_st -> e: FStar.Stubs.Reflection.Types.term -> FStar.Stubs.Reflection.Types.term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Syntax.Base.comp_st", "FStar.Stubs.Reflection.Types.term", "Pulse.Syntax.Base.uu___is_C_ST", "Pulse.Reflection.Util.mk_sub_stt", "Prims.bool", "Pulse.Syntax.Base.uu___is_C_STAtomic", "Pulse.Reflection.Util.mk_sub_stt_atomic", "Pulse.Elaborate.Pure.elab_term", "Pulse.Syntax.Base.comp_inames", "Pulse.Reflection.Util.mk_sub_stt_ghost", "Pulse.Reflection.Util.mk_abs", "FStar.Stubs.Reflection.V2.Data.Q_Explicit", "Pulse.Syntax.Base.comp_post", "Pulse.Syntax.Base.comp_pre", "Pulse.Syntax.Base.universe", "Pulse.Syntax.Base.comp_u", "Pulse.Syntax.Base.comp_res" ]
[]
false
false
false
true
false
let elab_sub (c1 c2: comp_st) (e: R.term) =
let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e
false
IfcRulesReify.fst
IfcRulesReify.inv_com'
val inv_com' (env: label_fun) (c: com) (l: label) (h0: heap) : Tot Type0
val inv_com' (env: label_fun) (c: com) (l: label) (h0: heap) : Tot Type0
let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 85, "end_line": 94, "start_col": 0, "start_line": 89 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> c: WhileReify.com -> l: IfcRulesReify.label -> h0: FStar.DM4F.Heap.IntStoreFixed.heap -> Type0
Prims.Tot
[ "total" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.com", "IfcRulesReify.label", "FStar.DM4F.Heap.IntStoreFixed.heap", "WhileReify.interpret_com", "Prims.l_True", "Prims.l_Forall", "FStar.DM4F.Heap.IntStoreFixed.id", "Prims.l_imp", "Prims.b2t", "IfcRulesReify.op_Less", "Prims.op_Equality", "Prims.int", "FStar.DM4F.Heap.IntStoreFixed.index" ]
[]
false
false
false
true
true
let inv_com' (env: label_fun) (c: com) (l: label) (h0: heap) : Tot Type0 =
match interpret_com h0 c with | None -> True | Some h1 -> forall (i: id). env i < l ==> index h0 i = index h1 i
false
Pulse.Elaborate.Core.fst
Pulse.Elaborate.Core.intro_pure_tm
val intro_pure_tm : p: Pulse.Syntax.Base.term -> Pulse.Syntax.Base.st_term
let intro_pure_tm (p:term) = let open Pulse.Reflection.Util in wtag (Some STT_Ghost) (Tm_STApp { head = tm_pureapp (tm_fvar (as_fv (mk_pulse_lib_core_lid "intro_pure"))) None p; arg_qual = None; arg = tm_fstar (`()) Range.range_0 })
{ "file_name": "lib/steel/pulse/Pulse.Elaborate.Core.fst", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 47, "end_line": 147, "start_col": 0, "start_line": 138 }
(* Copyright 2023 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module Pulse.Elaborate.Core module RT = FStar.Reflection.Typing module R = FStar.Reflection.V2 module L = FStar.List.Tot module T = FStar.Tactics.V2 open FStar.List.Tot open Pulse.Syntax open Pulse.Elaborate.Pure open Pulse.Typing module RU = Pulse.RuntimeUtils open Pulse.Reflection.Util let elab_frame (c:comp_st) (frame:term) (e:R.term) = let u = comp_u c in let ty = elab_term (comp_res c) in let pre = elab_term (comp_pre c) in let post = elab_term (comp_post c) in if C_ST? c then mk_frame_stt u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else if C_STAtomic? c then let opened = elab_term (comp_inames c) in mk_frame_stt_atomic u ty opened pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e else mk_frame_stt_ghost u ty pre (mk_abs ty R.Q_Explicit post) (elab_term frame) e let elab_sub (c1 c2:comp_st) (e:R.term) = let ty = elab_term (comp_res c1) in let u = comp_u c1 in let pre1 = elab_term (comp_pre c1) in let pre2 = elab_term (comp_pre c2) in let post1 = mk_abs ty R.Q_Explicit (elab_term (comp_post c1)) in let post2 = mk_abs ty R.Q_Explicit (elab_term (comp_post c2)) in if C_ST? c1 then mk_sub_stt u ty pre1 pre2 post1 post2 e else if C_STAtomic? c1 then let opened = elab_term (comp_inames c1) in mk_sub_stt_atomic u ty opened pre1 pre2 post1 post2 e else mk_sub_stt_ghost u ty pre1 pre2 post1 post2 e let elab_bind #g #x #c1 #c2 #c (bc:bind_comp g x c1 c2 c) (e1 e2:R.term) : R.term = let t1 = elab_term (comp_res c1) in let t2 = elab_term (comp_res c2) in match c1 with | C_ST _ -> mk_bind_stt (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STGhost _ -> mk_bind_ghost (comp_u c1) (comp_u c2) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 | C_STAtomic inames obs1 _ -> let C_STAtomic _ obs2 _ = c2 in mk_bind_atomic (comp_u c1) (comp_u c2) (elab_observability obs1) (elab_observability obs2) (elab_term (comp_inames c1)) t1 t2 (elab_term (comp_pre c1)) (mk_abs t1 R.Q_Explicit (elab_term (comp_post c1))) (mk_abs t2 R.Q_Explicit (elab_term (comp_post c2))) e1 e2 let elab_lift #g #c1 #c2 (d:lift_comp g c1 c2) (e:R.term) : Tot R.term = match d with | Lift_STAtomic_ST _ _ -> let t = elab_term (comp_res c1) in mk_lift_atomic_stt (comp_u c1) (elab_term (comp_res c1)) t (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Observability _ c o2 -> let t = elab_term (comp_res c1) in mk_lift_observability (comp_u c1) (elab_observability (C_STAtomic?.obs c)) (elab_observability o2) (elab_term (comp_inames c1)) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e | Lift_Ghost_Neutral _ _ (| reveal_a, reveal_a_typing |) -> let t = elab_term (comp_res c1) in mk_lift_ghost_neutral (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e (elab_term reveal_a) | Lift_Neutral_Ghost _ c -> let t = elab_term (comp_res c1) in mk_lift_neutral_ghost (comp_u c1) t (elab_term (comp_pre c1)) (mk_abs t R.Q_Explicit (elab_term (comp_post c1))) e
{ "checked_file": "/", "dependencies": [ "Pulse.Typing.fst.checked", "Pulse.Syntax.fst.checked", "Pulse.RuntimeUtils.fsti.checked", "Pulse.Reflection.Util.fst.checked", "Pulse.Elaborate.Pure.fst.checked", "prims.fst.checked", "FStar.Tactics.V2.fst.checked", "FStar.Sealed.fsti.checked", "FStar.Reflection.V2.fst.checked", "FStar.Reflection.Typing.fsti.checked", "FStar.Range.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.List.Tot.fst.checked" ], "interface_file": false, "source_file": "Pulse.Elaborate.Core.fst" }
[ { "abbrev": false, "full_module": "Pulse.Reflection.Util", "short_module": null }, { "abbrev": true, "full_module": "Pulse.RuntimeUtils", "short_module": "RU" }, { "abbrev": false, "full_module": "Pulse.Typing", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate.Pure", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Syntax", "short_module": null }, { "abbrev": false, "full_module": "FStar.List.Tot", "short_module": null }, { "abbrev": true, "full_module": "FStar.Tactics.V2", "short_module": "T" }, { "abbrev": true, "full_module": "FStar.List.Tot", "short_module": "L" }, { "abbrev": true, "full_module": "FStar.Reflection.V2", "short_module": "R" }, { "abbrev": true, "full_module": "FStar.Reflection.Typing", "short_module": "RT" }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "Pulse.Elaborate", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p: Pulse.Syntax.Base.term -> Pulse.Syntax.Base.st_term
Prims.Tot
[ "total" ]
[]
[ "Pulse.Syntax.Base.term", "Pulse.Typing.wtag", "FStar.Pervasives.Native.Some", "Pulse.Syntax.Base.ctag", "Pulse.Syntax.Base.STT_Ghost", "Pulse.Syntax.Base.Tm_STApp", "Pulse.Syntax.Base.Mkst_term'__Tm_STApp__payload", "Pulse.Syntax.Pure.tm_pureapp", "Pulse.Syntax.Pure.tm_fvar", "Pulse.Syntax.Base.as_fv", "Pulse.Reflection.Util.mk_pulse_lib_core_lid", "FStar.Pervasives.Native.None", "Pulse.Syntax.Base.qualifier", "Pulse.Syntax.Base.tm_fstar", "FStar.Range.range_0", "Pulse.Syntax.Base.st_term" ]
[]
false
false
false
true
false
let intro_pure_tm (p: term) =
let open Pulse.Reflection.Util in wtag (Some STT_Ghost) (Tm_STApp ({ head = tm_pureapp (tm_fvar (as_fv (mk_pulse_lib_core_lid "intro_pure"))) None p; arg_qual = None; arg = tm_fstar (`()) Range.range_0 }))
false
IfcRulesReify.fst
IfcRulesReify.assign_inv_com'
val assign_inv_com' (env: label_fun) (e: exp) (r: id) (h0: heap) : Lemma (inv_com' env (Assign r e) (env r) h0)
val assign_inv_com' (env: label_fun) (e: exp) (r: id) (h0: heap) : Lemma (inv_com' env (Assign r e) (env r) h0)
let assign_inv_com' (env:label_fun) (e:exp) (r:id) (h0:heap) : Lemma (inv_com' env (Assign r e) (env r) h0) = let v = reify (interpret_exp_st e) h0 in match reify (interpret_com_st (Assign r e) h0) h0 with | None, h1 -> () | Some (), h1 -> assert (h1 == upd h0 r v)
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 29, "end_line": 217, "start_col": 0, "start_line": 210 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end let ni_com (env:label_fun) (c:com) (l:label) : Tot Type0 = (forall (h0: rel heap). (* {:pattern (low_equiv env h0)} *) ni_com' env c l h0) /\ (forall (h0:heap). (* {:pattern (Some? (interpret_com h0 c))} *) inv_com' env c l h0) (*********************** Typing Rules for Expressions **********************) (* CH: The way we derive these rules looks more like a semantically-justified program logic than a syntactic type system. Any connection to Dave Naumann and Anindya Banerjee's "relational logic"? (e.g. https://arxiv.org/abs/1611.08992) *) (* Subtyping rule for expression labels E |- e : l1 l1 <= l2 ---------------------- E |- e : l2 *) val sub_exp : env:label_fun -> e:exp -> l1:label -> l2:label -> Lemma (requires (l1 <= l2 /\ ni_exp env e l1)) (ensures (ni_exp env e l2)) let sub_exp _ _ _ _ = () (* Typing rule for dereferencing ---------------- E | - r : E(r) *) val avar_exp : env:label_fun -> r:id -> Lemma (ensures (ni_exp env (AVar r) (env r))) let avar_exp _ _ = () (* Typing rule for Int constants i : int ------- i : Low *) val aint_exp : env:label_fun -> i:int -> Lemma (requires True) (ensures (ni_exp env (AInt i) Low)) let aint_exp _ _ = () (* Typing rule for binary operators e1 : l e2 : l ---------------- e1 `op` e2 : l *) val binop_exp : env:label_fun -> op:binop -> e1:exp -> e2:exp -> l:label -> Lemma (requires (ni_exp env e1 l) /\ (ni_exp env e2 l)) (ensures (ni_exp env (AOp op e1 e2) l)) let binop_exp env op e1 e2 l = () (************************ Typing Rules for Commands ************************) (* Subtyping rule for commands env,pc:l1 |- c l2 <= l1 --------------------------- env,pc:l2 |- c *) val sub_com : env:label_fun -> c:com -> l1:label -> l2:label -> Lemma (requires (l2 <= l1 /\ ni_com env c l1 )) (ensures (ni_com env c l2 )) let sub_com _ _ _ _ = () (* Typing rule for assignment env |- e : env(r) ------------------------ env, pc:env(r) |- r := e - label of expression and context label have to be below label of r (first one to prevent explicit, second to prevent implicit flows) *) let assign_inv_com0 (env:label_fun) (e:exp) (r:id) (ne:squash(ni_exp env e (env r))) (h0:rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0) = FStar.Squash.give_proof ne ; let vr = reify (interpret_exp_st e) (R?.r h0) in let vl = reify (interpret_exp_st e) (R?.l h0) in match reify (interpret_com_st (Assign r e) (R?.l h0)) (R?.l h0) with | Some (), h1l -> begin match reify (interpret_com_st (Assign r e) (R?.r h0)) (R?.r h0) with | Some (), h1r -> assert (h1l = upd (R?.l h0) r vl /\ h1r = upd (R?.r h0) r vr) | None, _ -> () end | None, _ -> ()
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> e: WhileReify.exp -> r: FStar.DM4F.Heap.IntStoreFixed.id -> h0: FStar.DM4F.Heap.IntStoreFixed.heap -> FStar.Pervasives.Lemma (ensures IfcRulesReify.inv_com' env (WhileReify.Assign r e) (env r) h0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.exp", "FStar.DM4F.Heap.IntStoreFixed.id", "FStar.DM4F.Heap.IntStoreFixed.heap", "WhileReify.interpret_com_st", "WhileReify.Assign", "Prims.unit", "Prims._assert", "Prims.eq2", "FStar.DM4F.Heap.IntStoreFixed.upd", "Prims.int", "WhileReify.interpret_exp_st", "Prims.l_True", "Prims.squash", "IfcRulesReify.inv_com'", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
false
false
true
false
false
let assign_inv_com' (env: label_fun) (e: exp) (r: id) (h0: heap) : Lemma (inv_com' env (Assign r e) (env r) h0) =
let v = reify (interpret_exp_st e) h0 in match reify (interpret_com_st (Assign r e) h0) h0 with | None, h1 -> () | Some (), h1 -> assert (h1 == upd h0 r v)
false
IfcRulesReify.fst
IfcRulesReify.assign_com
val assign_com : env:label_fun -> e:exp -> r:id -> Lemma (requires (ni_exp env e (env r))) (ensures (ni_com env (Assign r e) (env r)))
val assign_com : env:label_fun -> e:exp -> r:id -> Lemma (requires (ni_exp env e (env r))) (ensures (ni_com env (Assign r e) (env r)))
let assign_com env e r = forall_intro (assign_inv_com0 env e r (FStar.Squash.get_proof (ni_exp env e (env r)))) ; forall_intro (assign_inv_com' env e r)
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 40, "end_line": 224, "start_col": 0, "start_line": 222 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end let ni_com (env:label_fun) (c:com) (l:label) : Tot Type0 = (forall (h0: rel heap). (* {:pattern (low_equiv env h0)} *) ni_com' env c l h0) /\ (forall (h0:heap). (* {:pattern (Some? (interpret_com h0 c))} *) inv_com' env c l h0) (*********************** Typing Rules for Expressions **********************) (* CH: The way we derive these rules looks more like a semantically-justified program logic than a syntactic type system. Any connection to Dave Naumann and Anindya Banerjee's "relational logic"? (e.g. https://arxiv.org/abs/1611.08992) *) (* Subtyping rule for expression labels E |- e : l1 l1 <= l2 ---------------------- E |- e : l2 *) val sub_exp : env:label_fun -> e:exp -> l1:label -> l2:label -> Lemma (requires (l1 <= l2 /\ ni_exp env e l1)) (ensures (ni_exp env e l2)) let sub_exp _ _ _ _ = () (* Typing rule for dereferencing ---------------- E | - r : E(r) *) val avar_exp : env:label_fun -> r:id -> Lemma (ensures (ni_exp env (AVar r) (env r))) let avar_exp _ _ = () (* Typing rule for Int constants i : int ------- i : Low *) val aint_exp : env:label_fun -> i:int -> Lemma (requires True) (ensures (ni_exp env (AInt i) Low)) let aint_exp _ _ = () (* Typing rule for binary operators e1 : l e2 : l ---------------- e1 `op` e2 : l *) val binop_exp : env:label_fun -> op:binop -> e1:exp -> e2:exp -> l:label -> Lemma (requires (ni_exp env e1 l) /\ (ni_exp env e2 l)) (ensures (ni_exp env (AOp op e1 e2) l)) let binop_exp env op e1 e2 l = () (************************ Typing Rules for Commands ************************) (* Subtyping rule for commands env,pc:l1 |- c l2 <= l1 --------------------------- env,pc:l2 |- c *) val sub_com : env:label_fun -> c:com -> l1:label -> l2:label -> Lemma (requires (l2 <= l1 /\ ni_com env c l1 )) (ensures (ni_com env c l2 )) let sub_com _ _ _ _ = () (* Typing rule for assignment env |- e : env(r) ------------------------ env, pc:env(r) |- r := e - label of expression and context label have to be below label of r (first one to prevent explicit, second to prevent implicit flows) *) let assign_inv_com0 (env:label_fun) (e:exp) (r:id) (ne:squash(ni_exp env e (env r))) (h0:rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0) = FStar.Squash.give_proof ne ; let vr = reify (interpret_exp_st e) (R?.r h0) in let vl = reify (interpret_exp_st e) (R?.l h0) in match reify (interpret_com_st (Assign r e) (R?.l h0)) (R?.l h0) with | Some (), h1l -> begin match reify (interpret_com_st (Assign r e) (R?.r h0)) (R?.r h0) with | Some (), h1r -> assert (h1l = upd (R?.l h0) r vl /\ h1r = upd (R?.r h0) r vr) | None, _ -> () end | None, _ -> () let assign_inv_com' (env:label_fun) (e:exp) (r:id) (h0:heap) : Lemma (inv_com' env (Assign r e) (env r) h0) = let v = reify (interpret_exp_st e) h0 in match reify (interpret_com_st (Assign r e) h0) h0 with | None, h1 -> () | Some (), h1 -> assert (h1 == upd h0 r v) val assign_com : env:label_fun -> e:exp -> r:id -> Lemma (requires (ni_exp env e (env r)))
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> e: WhileReify.exp -> r: FStar.DM4F.Heap.IntStoreFixed.id -> FStar.Pervasives.Lemma (requires IfcRulesReify.ni_exp env e (env r)) (ensures IfcRulesReify.ni_com env (WhileReify.Assign r e) (env r))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.exp", "FStar.DM4F.Heap.IntStoreFixed.id", "FStar.Classical.forall_intro", "FStar.DM4F.Heap.IntStoreFixed.heap", "IfcRulesReify.inv_com'", "WhileReify.Assign", "IfcRulesReify.assign_inv_com'", "Prims.unit", "Rel.rel", "IfcRulesReify.ni_com'", "IfcRulesReify.assign_inv_com0", "FStar.Squash.get_proof", "IfcRulesReify.ni_exp" ]
[]
true
false
true
false
false
let assign_com env e r =
forall_intro (assign_inv_com0 env e r (FStar.Squash.get_proof (ni_exp env e (env r)))); forall_intro (assign_inv_com' env e r)
false
IfcRulesReify.fst
IfcRulesReify.assign_inv_com0
val assign_inv_com0 (env: label_fun) (e: exp) (r: id) (ne: squash (ni_exp env e (env r))) (h0: rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0)
val assign_inv_com0 (env: label_fun) (e: exp) (r: id) (ne: squash (ni_exp env e (env r))) (h0: rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0)
let assign_inv_com0 (env:label_fun) (e:exp) (r:id) (ne:squash(ni_exp env e (env r))) (h0:rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0) = FStar.Squash.give_proof ne ; let vr = reify (interpret_exp_st e) (R?.r h0) in let vl = reify (interpret_exp_st e) (R?.l h0) in match reify (interpret_com_st (Assign r e) (R?.l h0)) (R?.l h0) with | Some (), h1l -> begin match reify (interpret_com_st (Assign r e) (R?.r h0)) (R?.r h0) with | Some (), h1r -> assert (h1l = upd (R?.l h0) r vl /\ h1r = upd (R?.r h0) r vr) | None, _ -> () end | None, _ -> ()
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 17, "end_line": 208, "start_col": 0, "start_line": 196 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end let ni_com (env:label_fun) (c:com) (l:label) : Tot Type0 = (forall (h0: rel heap). (* {:pattern (low_equiv env h0)} *) ni_com' env c l h0) /\ (forall (h0:heap). (* {:pattern (Some? (interpret_com h0 c))} *) inv_com' env c l h0) (*********************** Typing Rules for Expressions **********************) (* CH: The way we derive these rules looks more like a semantically-justified program logic than a syntactic type system. Any connection to Dave Naumann and Anindya Banerjee's "relational logic"? (e.g. https://arxiv.org/abs/1611.08992) *) (* Subtyping rule for expression labels E |- e : l1 l1 <= l2 ---------------------- E |- e : l2 *) val sub_exp : env:label_fun -> e:exp -> l1:label -> l2:label -> Lemma (requires (l1 <= l2 /\ ni_exp env e l1)) (ensures (ni_exp env e l2)) let sub_exp _ _ _ _ = () (* Typing rule for dereferencing ---------------- E | - r : E(r) *) val avar_exp : env:label_fun -> r:id -> Lemma (ensures (ni_exp env (AVar r) (env r))) let avar_exp _ _ = () (* Typing rule for Int constants i : int ------- i : Low *) val aint_exp : env:label_fun -> i:int -> Lemma (requires True) (ensures (ni_exp env (AInt i) Low)) let aint_exp _ _ = () (* Typing rule for binary operators e1 : l e2 : l ---------------- e1 `op` e2 : l *) val binop_exp : env:label_fun -> op:binop -> e1:exp -> e2:exp -> l:label -> Lemma (requires (ni_exp env e1 l) /\ (ni_exp env e2 l)) (ensures (ni_exp env (AOp op e1 e2) l)) let binop_exp env op e1 e2 l = () (************************ Typing Rules for Commands ************************) (* Subtyping rule for commands env,pc:l1 |- c l2 <= l1 --------------------------- env,pc:l2 |- c *) val sub_com : env:label_fun -> c:com -> l1:label -> l2:label -> Lemma (requires (l2 <= l1 /\ ni_com env c l1 )) (ensures (ni_com env c l2 )) let sub_com _ _ _ _ = () (* Typing rule for assignment env |- e : env(r) ------------------------ env, pc:env(r) |- r := e - label of expression and context label have to be below label of r (first one to prevent explicit, second to prevent implicit flows) *)
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> e: WhileReify.exp -> r: FStar.DM4F.Heap.IntStoreFixed.id -> ne: Prims.squash (IfcRulesReify.ni_exp env e (env r)) -> h0: Rel.rel FStar.DM4F.Heap.IntStoreFixed.heap -> FStar.Pervasives.Lemma (ensures IfcRulesReify.ni_com' env (WhileReify.Assign r e) (env r) h0)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.exp", "FStar.DM4F.Heap.IntStoreFixed.id", "Prims.squash", "IfcRulesReify.ni_exp", "Rel.rel", "FStar.DM4F.Heap.IntStoreFixed.heap", "WhileReify.interpret_com_st", "WhileReify.Assign", "Rel.__proj__R__item__l", "Prims.unit", "Rel.__proj__R__item__r", "Prims._assert", "Prims.l_and", "Prims.b2t", "Prims.op_Equality", "FStar.DM4F.Heap.IntStoreFixed.upd", "Prims.int", "WhileReify.interpret_exp_st", "FStar.Squash.give_proof", "Prims.l_True", "IfcRulesReify.ni_com'", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
false
false
true
false
false
let assign_inv_com0 (env: label_fun) (e: exp) (r: id) (ne: squash (ni_exp env e (env r))) (h0: rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0) =
FStar.Squash.give_proof ne; let vr = reify (interpret_exp_st e) (R?.r h0) in let vl = reify (interpret_exp_st e) (R?.l h0) in match reify (interpret_com_st (Assign r e) (R?.l h0)) (R?.l h0) with | Some (), h1l -> (match reify (interpret_com_st (Assign r e) (R?.r h0)) (R?.r h0) with | Some (), h1r -> assert (h1l = upd (R?.l h0) r vl /\ h1r = upd (R?.r h0) r vr) | None, _ -> ()) | None, _ -> ()
false
Vale.Stdcalls.X64.Aes.fst
Vale.Stdcalls.X64.Aes.lowstar_key256
val lowstar_key256:lowstar_key256_t
val lowstar_key256:lowstar_key256_t
let lowstar_key256 : lowstar_key256_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key256 dom (W.mk_prediction code_key256 dom [] (key256_lemma code_key256 IA.win))
{ "file_name": "vale/code/arch/x64/interop/Vale.Stdcalls.X64.Aes.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 74, "end_line": 38, "start_col": 0, "start_line": 33 }
module Vale.Stdcalls.X64.Aes open FStar.Mul open FStar.HyperStack.ST module HS = FStar.HyperStack module B = LowStar.Buffer module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open Vale.Def.Types_s open Vale.Interop.Base module IX64 = Vale.Interop.X64 module VSig = Vale.AsLowStar.ValeSig module LSig = Vale.AsLowStar.LowStarSig module ME = Vale.X64.Memory module V = Vale.X64.Decls module IA = Vale.Interop.Assumptions module W = Vale.AsLowStar.Wrapper open Vale.X64.MemoryAdapters module VS = Vale.X64.State module MS = Vale.X64.Machine_s let lowstar_key128 : lowstar_key128_t = assert_norm (List.length dom + List.length ([]<:list arg) <= 4); IX64.wrap_weak_stdcall code_key128 dom (W.mk_prediction code_key128 dom [] (key128_lemma code_key128 IA.win)) let aes128_key_expansion //: normal lowstar_key128_t = as_normal_t #lowstar_key128_t lowstar_key128
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.MemoryAdapters.fsti.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.Decls.fsti.checked", "Vale.Interop.X64.fsti.checked", "Vale.Interop.Base.fst.checked", "Vale.Interop.Assumptions.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.AsLowStar.Wrapper.fsti.checked", "Vale.AsLowStar.ValeSig.fst.checked", "Vale.AsLowStar.LowStarSig.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.List.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked" ], "interface_file": true, "source_file": "Vale.Stdcalls.X64.Aes.fst" }
[ { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Vale.AES.X64.AES", "short_module": "AE" }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": true, "full_module": "Vale.X64.Machine_s", "short_module": "MS" }, { "abbrev": true, "full_module": "Vale.X64.State", "short_module": "VS" }, { "abbrev": false, "full_module": "Vale.X64.MemoryAdapters", "short_module": null }, { "abbrev": true, "full_module": "Vale.AsLowStar.Wrapper", "short_module": "W" }, { "abbrev": true, "full_module": "Vale.Interop.Assumptions", "short_module": "IA" }, { "abbrev": true, "full_module": "Vale.X64.Decls", "short_module": "V" }, { "abbrev": true, "full_module": "Vale.X64.Memory", "short_module": "ME" }, { "abbrev": true, "full_module": "Vale.AsLowStar.LowStarSig", "short_module": "LSig" }, { "abbrev": true, "full_module": "Vale.AsLowStar.ValeSig", "short_module": "VSig" }, { "abbrev": true, "full_module": "Vale.Interop.X64", "short_module": "IX64" }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Stdcalls.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Vale.Stdcalls.X64.Aes.lowstar_key256_t
Prims.Tot
[ "total" ]
[]
[ "Vale.Interop.X64.wrap_weak_stdcall", "Vale.Stdcalls.X64.Aes.code_key256", "Vale.Stdcalls.X64.Aes.dom", "Vale.AsLowStar.Wrapper.pre_rel_generic", "Vale.Interop.X64.max_stdcall", "Vale.Interop.X64.arg_reg_stdcall", "Prims.Nil", "Vale.Interop.Base.arg", "Vale.Stdcalls.X64.Aes.key256_pre", "Vale.AsLowStar.Wrapper.post_rel_generic", "Vale.Stdcalls.X64.Aes.key256_post", "Vale.AsLowStar.Wrapper.mk_prediction", "Vale.Interop.X64.regs_modified_stdcall", "Vale.Interop.X64.xmms_modified_stdcall", "Vale.Stdcalls.X64.Aes.key256_lemma", "Vale.Interop.Assumptions.win", "Prims.unit", "FStar.Pervasives.assert_norm", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "FStar.List.Tot.Base.length", "Vale.Interop.Base.td", "Prims.list" ]
[]
false
false
false
true
false
let lowstar_key256:lowstar_key256_t =
assert_norm (List.length dom + List.length ([] <: list arg) <= 4); IX64.wrap_weak_stdcall code_key256 dom (W.mk_prediction code_key256 dom [] (key256_lemma code_key256 IA.win))
false
IfcRulesReify.fst
IfcRulesReify.seq_com
val seq_com : env:label_fun -> c1:com -> c2:com -> l:label -> Lemma (requires (ni_com env c1 l /\ ni_com env c2 l)) (ensures (ni_com env (Seq c1 c2) l))
val seq_com : env:label_fun -> c1:com -> c2:com -> l:label -> Lemma (requires (ni_com env c1 l /\ ni_com env c2 l)) (ensures (ni_com env (Seq c1 c2) l))
let seq_com env c1 c2 l = forall_intro (fun (h0:rel heap) -> seq_com' env c1 c2 l h0 <: Lemma (ni_com' env (Seq c1 c2) l h0)) ; forall_intro (fun (h0:heap) -> seq_inv_com' env c1 c2 l h0 <: Lemma (inv_com' env (Seq c1 c2) l h0))
{ "file_name": "examples/rel/IfcRulesReify.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 75, "end_line": 309, "start_col": 0, "start_line": 303 }
(* Copyright 2008-2018 Microsoft Research Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *) module IfcRulesReify open Rel open WhileReify open FStar.DM4F.Heap.IntStoreFixed open FStar.DM4F.IntStoreExcFixed open FStar.Squash open FStar.Classical (****************************** Preliminaries ******************************) (* CH: Everything specialized to 2-point lattice *) type label = | Low | High val op_Less : label -> label -> Tot bool let op_Less l1 l2 = match l1, l2 with | Low,High -> true | _, _ -> false val op_Less_Equals : label -> label -> Tot bool let op_Less_Equals l1 l2 = match l1, l2 with | High,Low -> false | _, _ -> true val join : label -> label -> Tot label let join l1 l2 = match l1, l2 with | Low,Low -> Low | _, _ -> High val meet : label -> label -> Tot label let meet l1 l2 = match l1, l2 with | High, High -> High | _, _ -> Low let universal_property_meet l l1 l2 : Lemma (requires (l <= l1 /\ l <= l2)) (ensures (l <= meet l1 l2)) = () type label_fun = id -> Tot label type low_equiv (env:label_fun) (h1:rel heap) = (forall (x:id). (* {:pattern (env x)} *) env x = Low ==> index (R?.l h1) x = index (R?.r h1) x) (**************************** Typing Judgements ****************************) (* env |- e : l - Expressions do not modify the heap - Correctness - Low equivalent input heaps + Low label ==> same result *) let ni_exp (env:label_fun) (e:exp) (l:label) : Tot Type0 = forall (h: rel heap). (* {:pattern (low_equiv env h)} *) (low_equiv env h /\ Low? l) ==> (* interpret_exp (R?.r h) e = interpret_exp (R?.l h) e *) begin let vr = reify (interpret_exp_st e) (R?.r h)in let vl = reify (interpret_exp_st e) (R?.l h) in vr = vl end (* env,pc:l |- c - References with a label below l are not modified - Total correctness - Low equivalent input heaps ==> Low equivalent output heaps *) let inv_com' (env:label_fun) (c:com) (l:label) (h0:heap) : Tot Type0 = match interpret_com h0 c with | None -> True | Some h1 -> forall (i:id). (* {:pattern (env i < l)} *) env i < l ==> index h0 i = index h1 i let ni_com' (env:label_fun) (c:com) (l:label) (h0:rel heap) : Tot Type0 = let R h0l h0r = h0 in (* KM : That's the code that we would like to write but subtyping and matching on pairs interplay badly *) (* it generates a VC which boils down to [forall (h1l:heap). length h1l = length h0l] which is obviously false *) (* begin match interpret_com h0l c, interpret_com h0r c with *) (* | Some h1l, Some h1r -> low_equiv env (R h0l h0r) ==> low_equiv env (R h1l h1r) *) (* | _ -> True *) (* end *) begin match interpret_com h0l c with | Some h1l -> begin match interpret_com h0r c with | Some h1r -> low_equiv env h0 ==> low_equiv env (R h1l h1r) | _ -> True end | _ -> True end let ni_com (env:label_fun) (c:com) (l:label) : Tot Type0 = (forall (h0: rel heap). (* {:pattern (low_equiv env h0)} *) ni_com' env c l h0) /\ (forall (h0:heap). (* {:pattern (Some? (interpret_com h0 c))} *) inv_com' env c l h0) (*********************** Typing Rules for Expressions **********************) (* CH: The way we derive these rules looks more like a semantically-justified program logic than a syntactic type system. Any connection to Dave Naumann and Anindya Banerjee's "relational logic"? (e.g. https://arxiv.org/abs/1611.08992) *) (* Subtyping rule for expression labels E |- e : l1 l1 <= l2 ---------------------- E |- e : l2 *) val sub_exp : env:label_fun -> e:exp -> l1:label -> l2:label -> Lemma (requires (l1 <= l2 /\ ni_exp env e l1)) (ensures (ni_exp env e l2)) let sub_exp _ _ _ _ = () (* Typing rule for dereferencing ---------------- E | - r : E(r) *) val avar_exp : env:label_fun -> r:id -> Lemma (ensures (ni_exp env (AVar r) (env r))) let avar_exp _ _ = () (* Typing rule for Int constants i : int ------- i : Low *) val aint_exp : env:label_fun -> i:int -> Lemma (requires True) (ensures (ni_exp env (AInt i) Low)) let aint_exp _ _ = () (* Typing rule for binary operators e1 : l e2 : l ---------------- e1 `op` e2 : l *) val binop_exp : env:label_fun -> op:binop -> e1:exp -> e2:exp -> l:label -> Lemma (requires (ni_exp env e1 l) /\ (ni_exp env e2 l)) (ensures (ni_exp env (AOp op e1 e2) l)) let binop_exp env op e1 e2 l = () (************************ Typing Rules for Commands ************************) (* Subtyping rule for commands env,pc:l1 |- c l2 <= l1 --------------------------- env,pc:l2 |- c *) val sub_com : env:label_fun -> c:com -> l1:label -> l2:label -> Lemma (requires (l2 <= l1 /\ ni_com env c l1 )) (ensures (ni_com env c l2 )) let sub_com _ _ _ _ = () (* Typing rule for assignment env |- e : env(r) ------------------------ env, pc:env(r) |- r := e - label of expression and context label have to be below label of r (first one to prevent explicit, second to prevent implicit flows) *) let assign_inv_com0 (env:label_fun) (e:exp) (r:id) (ne:squash(ni_exp env e (env r))) (h0:rel heap) : Lemma (ni_com' env (Assign r e) (env r) h0) = FStar.Squash.give_proof ne ; let vr = reify (interpret_exp_st e) (R?.r h0) in let vl = reify (interpret_exp_st e) (R?.l h0) in match reify (interpret_com_st (Assign r e) (R?.l h0)) (R?.l h0) with | Some (), h1l -> begin match reify (interpret_com_st (Assign r e) (R?.r h0)) (R?.r h0) with | Some (), h1r -> assert (h1l = upd (R?.l h0) r vl /\ h1r = upd (R?.r h0) r vr) | None, _ -> () end | None, _ -> () let assign_inv_com' (env:label_fun) (e:exp) (r:id) (h0:heap) : Lemma (inv_com' env (Assign r e) (env r) h0) = let v = reify (interpret_exp_st e) h0 in match reify (interpret_com_st (Assign r e) h0) h0 with | None, h1 -> () | Some (), h1 -> assert (h1 == upd h0 r v) val assign_com : env:label_fun -> e:exp -> r:id -> Lemma (requires (ni_exp env e (env r))) (ensures (ni_com env (Assign r e) (env r))) let assign_com env e r = forall_intro (assign_inv_com0 env e r (FStar.Squash.get_proof (ni_exp env e (env r)))) ; forall_intro (assign_inv_com' env e r) let seq_nil1 (c1:com) (c2:com) (h:heap) : Lemma (requires (fst (reify (interpret_com_st c1 h) h) = None)) (ensures (fst (reify (interpret_com_st (Seq c1 c2) h) h) = None)) = () let seq_nil2 (c1:com) (c2:com) (h0:heap) (h1:heap) : Lemma (requires (h1 == snd (reify (interpret_com_st c1 h0) h0) /\ fst (reify (interpret_com_st c2 h1) h1) = None)) (ensures (fst (reify (interpret_com_st (Seq c1 c2) h0) h0) = None)) = () (* Sequencing rule for commands env,pc:l |- c1 env,pc:l |- c2 ------------------------------ env,pc:l |- c1; c2 *) val seq_inv_com' : env:label_fun -> c1:com -> c2:com -> l:label -> h0:heap -> Lemma (requires (ni_com env c1 l /\ ni_com env c2 l)) (ensures (inv_com' env (Seq c1 c2) l h0)) let seq_inv_com' env c1 c2 l h0 = match reify (interpret_com_st c1 h0) h0 with | None, _ -> seq_nil1 c1 c2 h0 | Some (), h1 -> match reify (interpret_com_st c2 h1) h1 with | None, _ -> seq_nil2 c1 c2 h0 h1 | Some (), h2 -> () #set-options "--z3rlimit 50" let use_ni_com (env:label_fun) (c:com) (l:label) (h:rel heap{low_equiv env h}) : Lemma (requires ni_com env c l) (ensures (let R hl hr = h in match reify (interpret_com_st c hl) hl, reify (interpret_com_st c hr) hr with | (Some _, hl'), (Some _, hr') -> low_equiv env (R hl' hr') | _ -> True)) = () val seq_com' : env:label_fun -> c1:com -> c2:com -> l:label -> h0: rel heap -> Lemma (requires (ni_com env c1 l /\ ni_com env c2 l)) (ensures (ni_com' env (Seq c1 c2) l h0)) let seq_com' env c1 c2 l h0 = if not (FStar.StrongExcludedMiddle.strong_excluded_middle (low_equiv env h0)) then () else begin assert (low_equiv env h0); let R h0l h0r = h0 in match reify (interpret_com_st c1 h0l) h0l with | None, _ -> seq_nil1 c1 c2 h0l | Some (), h1l -> match reify (interpret_com_st c1 h0r) h0r with | None, _ -> seq_nil1 c1 c2 h0r | Some (), h1r -> match reify (interpret_com_st c2 h1l) h1l with | None, _ -> seq_nil2 c1 c2 h0l h1l | Some (), h2l -> match reify (interpret_com_st c2 h1r) h1r with | None, _ -> seq_nil2 c1 c2 h0r h1r | Some (), h2r -> let h1 = R h1l h1r in use_ni_com env c1 l h0; assert (low_equiv env h1) ; let h2 = R h2l h2r in use_ni_com env c2 l h1; assert (low_equiv env h2) end val seq_com : env:label_fun -> c1:com -> c2:com -> l:label -> Lemma (requires (ni_com env c1 l /\ ni_com env c2 l))
{ "checked_file": "/", "dependencies": [ "WhileReify.fst.checked", "Rel.fst.checked", "prims.fst.checked", "FStar.StrongExcludedMiddle.fst.checked", "FStar.Squash.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.DM4F.IntStoreExcFixed.fst.checked", "FStar.DM4F.Heap.IntStoreFixed.fsti.checked", "FStar.Classical.fsti.checked" ], "interface_file": false, "source_file": "IfcRulesReify.fst" }
[ { "abbrev": false, "full_module": "FStar.Classical", "short_module": null }, { "abbrev": false, "full_module": "FStar.Squash", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.IntStoreExcFixed", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.IntStoreFixed", "short_module": null }, { "abbrev": false, "full_module": "WhileReify", "short_module": null }, { "abbrev": false, "full_module": "Rel", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
env: IfcRulesReify.label_fun -> c1: WhileReify.com -> c2: WhileReify.com -> l: IfcRulesReify.label -> FStar.Pervasives.Lemma (requires IfcRulesReify.ni_com env c1 l /\ IfcRulesReify.ni_com env c2 l) (ensures IfcRulesReify.ni_com env (WhileReify.Seq c1 c2) l)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "IfcRulesReify.label_fun", "WhileReify.com", "IfcRulesReify.label", "FStar.Classical.forall_intro", "FStar.DM4F.Heap.IntStoreFixed.heap", "IfcRulesReify.inv_com'", "WhileReify.Seq", "IfcRulesReify.seq_inv_com'", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern", "Rel.rel", "IfcRulesReify.ni_com'", "IfcRulesReify.seq_com'" ]
[]
false
false
true
false
false
let seq_com env c1 c2 l =
forall_intro (fun (h0: rel heap) -> seq_com' env c1 c2 l h0 <: Lemma (ni_com' env (Seq c1 c2) l h0)); forall_intro (fun (h0: heap) -> seq_inv_com' env c1 c2 l h0 <: Lemma (inv_com' env (Seq c1 c2) l h0) )
false

This dataset is the Version 2.0 of microsoft/FStarDataSet.

Primary-Objective

This dataset's primary objective is to train and evaluate Proof-oriented Programming with AI (PoPAI, in short). Given a specification of a program and proof in F*, the objective of a AI model is to synthesize the implemantation (see below for details about the usage of this dataset, including the input and output).

Data Format

Each of the examples in this dataset are organized as dictionaries with the following schema

{
    "file_name": <str: Name of the file>,
    "name": <str: name of the example, can be used to uniquely identify the example>,
    "original_source_type": <str: actual source type, to be used for type checking>,
    "source_type": <str: modified source type, to be used to formulate prompt>,
    "source_definition": <str: target definition>,
    "source": <dict: contains metadata about the source of this example, including project_name, git url, git sha, etc.>,
    "source_range": <dict: metadata containing start and end lines and columns of this definition in the source file>,
    "file_context": <str: extracted file context upto the point of current definition>, 
    "dependencies": <dict: build dependencies for this file>,
    "opens_and_abbrevs": <list[dict]: List of opened modules and abbreviated modules in the file, necessary for evaluation.>,
    "vconfig": <dict: SMT solver flags for this definition>,
    "interleaved": <bool: whether this definition is interleaved from the interface file>,
    "verbose_type": <str: the verbose type of this definition as resolved by the type checker>,
    "effect": <str: effect>,
    "effect_flags": <list[str]: any effect flags>,
    "mutual_with": <list: if this definition is mutually recursive with another, list of those names>,
    "ideal_premises": <list[str]: Other definitions that are used in the ground truth definition>,
    "proof_features": <list[str]>,
    "is_simple_lemma": <bool/null>,
    "is_div": <bool: if this definition has the divergent effect>,
    "is_proof": <bool>,
    "is_simply_typed": <bool>,
    "is_type": <bool/null>,
    "partial_definition": <str>,
    "completed_definiton": <str>,
    "isa_cross_project_example": <bool: if this example belongs to the cross-project evaluation set>
}

Usage

To use this dataset with datasets,

from datasets import load_dataset

data = load_dataset("microsoft/FStarDataSet-V2")
train_data = data["train"]
eval_data = data["validation"]
test_data = data["test"]

intra_project_test = test_data.filter(lambda x: x["isa_cross_project_example"] == False)
cross_project_test = test_data.filter(lambda x: x["isa_cross_project_example"] == True)

Input

The primary input for generating F* definition is source_type. All other information in an example may be used directly or to derive an input except source_definition, ideal_premises, and completed_definiton.

Output

The primary output is source_definition, which is the ground truth definition, that can be evaluated with the proof checker. The completed_definiton may be used as ground truth when a model is used as a text completion setting (though the evaluator does not support evaluation in this setting). In addition, ideal_premises may be used for evaluating premise selection models.

Evaluation on this dataset

Generated F* definitions should be evaluated the proof checker tool from https://github.com/FStarLang/fstar_dataset/releases/tag/eval-v2.0. Download the source code and the helpers.zip file from the release.

Troubleshooting

The attached binaries in the evaluator (i.e., fstar.exe and z3) are built on Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-189-generic x86_64), gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2), OCaml 4.12.0. If any of the binaries do not work properly, build F* from this commit (10183ea187da8e8c426b799df6c825e24c0767d3) from the F* repository, using the installation guide.

Data Source

In addition to the eight projects in microsoft/FStarDataSet, data from four more projects are included in this version.

  1. Starmada: a framework for doing proofs by stepwise refinement for concurrent programs in a weak memory model. Starmada is an experimental version of Armada implemented in F⋆, relying on various advanced features of F⋆’s dependent type system for more generic and abstract proofs.
  2. Zeta: a high performance, concurrent monitor for stateful services proven correct in F⋆ and its Steel concurrent separation logic
  3. Dice-star: a verified implementation of the DICE measured boot protocol for embedded devices
  4. Noise-star: a verified compiler for implementations of Noise protocols, a family of key-exchange protocols

Limitations

TDB

Citation

@inproceedings{chakraborty2024towards,
  title={Towards Neural Synthesis for SMT-Assisted Proof-Oriented Programming},
  author={Chakraborty, Saikat and Ebner, Gabriel and Bhat, Siddharth and Fakhoury, Sarah and Fatima, Sakina and Lahiri, Shuvendu and Swamy, Nikhil},
  booktitle={Proceedings of the IEEE/ACM 47th International Conference on Software Engineering (To Appear)},
  pages={1--12},
  year={2025}
}
Downloads last month
92
Edit dataset card